elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  Progamación en Visual Basic
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Progamación en Visual Basic  (Leído 1,292 veces)
JSP-O

Desconectado Desconectado

Mensajes: 1


Ver Perfil
Progamación en Visual Basic
« en: 16 Febrero 2013, 22:15 pm »

Hola, tengo una pregunta sobre visual basic 2005, talvez me pueden ayudar.
quiero hacer un programa que tome fotos de lo que sucede hen la pantalla, pero no me se ningun codigo, ¿que codigo puedo poner?,talvez me ayudan


En línea

Danyfirex


Desconectado Desconectado

Mensajes: 493


My Dear Mizuho


Ver Perfil
Re: Progamación en Visual Basic
« Respuesta #1 en: 18 Febrero 2013, 01:33 am »

este codigo es para vb6.
estudialo.

Código
  1. 'Screen Capture Demo by Tanner Helland (published 2008, updated 2012)
  2. ' http://www.tannerhelland.com
  3.  
  4. 'If you like VB game and graphics code, be sure to subscribe to my RSS feed at
  5. ' http://www.tannerhelland.com/feed/
  6.  
  7. 'The required API calls are:
  8.  
  9. 'This call gives us the hWnd (window handle) of the screen
  10. Private Declare Function GetDesktopWindow Lib "user32" () As Long
  11.  
  12. 'This call assigns an hDC (handle of device context) from an hWnd
  13. Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
  14.  
  15. 'BitBlt lets us draw an image from a hDC to another hDC (in our case, from an hDC of the screen capture
  16. ' to the hDC of a VB picture box)
  17. Private Declare Function BitBlt Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, _
  18.  ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, _
  19.  ByVal ySrc As Long, ByVal opCode As Long) As Long
  20.  
  21. 'ReleaseDC will be used to release the screen's hDC once the screen capture is complete.
  22. Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hDC As Long) As Long
  23.  
  24. 'This sample project copies the screen when the form loads; you could also place this code in
  25. ' a command button (or any other input)
  26. Private Sub Form_Load()
  27.  
  28.    'First, minimize this window
  29.    Me.WindowState = vbMinimized
  30.  
  31.    'Get the hWnd of the screen
  32.    Dim scrHwnd As Long
  33.    scrHwnd = GetDesktopWindow
  34.  
  35.    'Now, assign an hDC to the hWnd we generated
  36.    Dim shDC As Long
  37.    shDC = GetDC(scrHwnd)
  38.  
  39.    'Determine the size of the screen
  40.    Dim screenWidth As Long, screenHeight As Long
  41.    screenWidth = Screen.Width \ Screen.TwipsPerPixelX
  42.    screenHeight = Screen.Height \ Screen.TwipsPerPixelY
  43.  
  44.    'Copy the data from the screen hDC to this VB form
  45.    BitBlt FormScreenCapture.hDC, 0, 0, screenWidth, screenHeight, shDC, 0, 0, vbSrcCopy
  46.  
  47.    'Release our hold on the screen's hDC
  48.    ReleaseDC scrHwnd, shDC
  49.  
  50.    'Set the picture of the form to equal its image
  51.    FormScreenCapture.Picture = FormScreenCapture.Image
  52.  
  53.    'Restore the window
  54.    Me.WindowState = vbNormal
  55.  
  56. End Sub


ya deja de usar vb 5 es algo viejo  :rolleyes: lo es el 6.


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines