elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Ingresar Registrarse
12 Octubre 2008, 22:00  



+  Foro de elhacker.net
|-+  Programación
| |-+  Programación VB (Moderadores: ||MadAntrax||, E0N)
| | |-+  error en codigo
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Imprimir
Autor Tema: error en codigo  (Leído 150 veces)
elguast

Desconectado Desconectado

Mensajes: 90


Ver Perfil
error en codigo
« en: 27 Junio 2008, 14:04 »

hola alguien me puede ayudar con este codigo me da error


Dim temp As Long
hwdc = capCreateCaptureWindow("CapWindow", ws_child Or ws_visible, _
0, 0, 320, 240, Picture1.hWnd, 0)
If (hwdc <> 0) Then
webcam = "Si"
temp = DestroyWindow(hwdc)
temp = SendMessage(hwdc, WM_CAP_DRIVER_DISCONNECT, 0&, 0&)
DoEvents
Else
webcam = "No"
End If
En línea
Xerok1!

Desconectado Desconectado

Mensajes: 230



Ver Perfil
Re: error en codigo
« Respuesta #1 en: 27 Junio 2008, 14:09 »

Asimple vista creo que no has definido la funcion capCreateCaptureWindow...

Salu2!
En línea

[Firma]Esperando haber si acaba el concurso de firmas y la pongo[/Firma]
cobein

Desconectado Desconectado

Mensajes: 467



Ver Perfil WWW
Re: error en codigo
« Respuesta #2 en: 27 Junio 2008, 14:25 »

No creo que sea la mejor forma de hacerlo... pero

Código
Option Explicit
 
Private Declare Function capCreateCaptureWindow Lib "avicap32.dll" Alias "capCreateCaptureWindowA" (ByVal lpszWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal nID As Long) As Long
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
Private Declare Function DestroyWindow Lib "user32.dll" (ByVal hwnd As Long) As Long
 
Private Const WM_CAP_START As Long = &H400
Private Const WM_CAP_DRIVER_DISCONNECT As Long = (WM_CAP_START + 11)
Private Const WM_CAP_DRIVER_CONNECT As Long = (WM_CAP_START + 10)
 
Private Sub Form_Load()
   Debug.Print IsWebCamPresent
End Sub
 
Private Function IsWebCamPresent() As Boolean
   Dim lRet As Long
   lRet = capCreateCaptureWindow(vbNullString, 0, 0, 0, 0, 0, 0, 0)
   If Not lRet = 0 Then
       If SendMessage(lRet, WM_CAP_DRIVER_CONNECT, ByVal 0&, ByVal 0&) Then
           Call SendMessage(lRet, WM_CAP_DRIVER_DISCONNECT, ByVal 0&, ByVal 0&)
           IsWebCamPresent = True
       End If
       Call DestroyWindow(lRet)
   End If
End Function
 
En línea

elguast

Desconectado Desconectado

Mensajes: 90


Ver Perfil
Re: error en codigo
« Respuesta #3 en: 27 Junio 2008, 19:58 »

muchas gracias por la ayuda
En línea
Páginas: [1] Ir Arriba Imprimir 
Ir a:  







Consolas     La Web de Goku     MilW0rm     MundoDivx

Hispabyte     Truzone     TodoReviews     ZonaPhotoshop

hard-h2o modding    Foros de ayuda    Yashira.org    Videojuegos    indetectables.net   

Noticias Informatica    Seguridad Informática    ADSL    Foros en español    eNYe Sec

Todas las webs afiliadas están libres de publicidad engañosa.

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC