首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

摄像头有关问题(小弟初接触vb)

2012-01-22 
摄像头问题(小弟初接触vb)ConstWS_CHILD&H40000000ConstWS_VISIBLE&H10000000ConstWM_CAP_START&H400Co

摄像头问题(小弟初接触vb)
Const   WS_CHILD   =   &H40000000
Const   WS_VISIBLE   =   &H10000000
Const   WM_CAP_START   =   &H400
Const   WM_CAP_STOP   =   WM_CAP_START   +   68
Const   WM_CAP_DRIVER_CONNECT   =   WM_CAP_START   +   10
Const   WM_CAP_DRIVER_DISCONNECT   =   WM_CAP_START   +   11
......
Private   Declare   Function   SendMessage&   Lib   "user32 "   Alias   "SendMessageA "   (ByVal   hwnd   As   Long,   ByVal   wMsg   As   Long,   ByVal   wParam   As   Long,   lParam   As   Any)
Private   Declare   Function   capCreateCaptureWindowA   Lib   "avicap32.dll "   (lpszWindowName   As   String,   dwStyle   As   Long,   x   As   Integer,   y   As   Integer,   nWidth   As   Integer,   nHeight   As   Integer,   ParentWin   As   Long,   nID   As   Integer)   As   Long
......

Private   Sub   Command1_Click()
    hWndC   =   capCreateCaptureWindowA( "windows ",   WS_VISIBLE   +   WS_CHILD,   Frame1.Left,   Frame1.Top,   Frame1.Width,   Frame1.Height,   Form1.hwnd,   0)
        If   hWndC   >   0   Then
              .....
        endif
End   Sub

为什么     hWndC   的值为0


[解决办法]
把:
hWndC = capCreateCaptureWindowA( "windows ", WS_VISIBLE + WS_CHILD, Frame1.Left, Frame1.Top, Frame1.Width, Frame1.Height, Form1.hwnd, 0)

修改成:
hWndC = capCreateCaptureWindowA(byval "windows ", WS_VISIBLE + WS_CHILD, Frame1.Left, Frame1.Top, Frame1.Width, Frame1.Height, Form1.hwnd, 0)

热点排行