关于sendmessage控制摄像头消息
最近研究控制摄像头拍照...网上找到相关代码通过capCreateCaptureWindow和sendmessage来实现.
现在也能实现了...就是有点疑问,关于sendmessage中发送的消息..网上没找到相关的说明
Private Const WS_CHILD = &H40000000
Private Const WS_VISIBLE = &H10000000
Private Const WM_USER = &H400
Private Const WM_CAP_START = &H400
Private Const WM_CAP_STOP = WM_CAP_START + 68
Private Const WM_CAP_EDIT_COPY = (WM_CAP_START + 30)
Private Const WM_CAP_DRIVER_CONNECT = (WM_CAP_START + 10)
Private Const WM_CAP_SET_PREVIEWRATE = (WM_CAP_START + 52)
Private Const WM_CAP_SET_OVERLAY = (WM_CAP_START + 51)
以上这些是不是自定义的消息?为什么能控制摄像头?然后有没有控制摄像头所有的相关消息和他的功能说明...
[解决办法]
这是VC里的常数定义
#define WM_CAP_START WM_USER// start of unicode messages#define WM_CAP_UNICODE_START WM_USER+100#define WM_CAP_GET_CAPSTREAMPTR (WM_CAP_START+ 1)#define WM_CAP_SET_CALLBACK_ERRORW (WM_CAP_UNICODE_START+ 2)#define WM_CAP_SET_CALLBACK_STATUSW (WM_CAP_UNICODE_START+ 3)#define WM_CAP_SET_CALLBACK_ERRORA (WM_CAP_START+ 2)#define WM_CAP_SET_CALLBACK_STATUSA (WM_CAP_START+ 3)#ifdef UNICODE#define WM_CAP_SET_CALLBACK_ERROR WM_CAP_SET_CALLBACK_ERRORW#define WM_CAP_SET_CALLBACK_STATUS WM_CAP_SET_CALLBACK_STATUSW#else#define WM_CAP_SET_CALLBACK_ERROR WM_CAP_SET_CALLBACK_ERRORA#define WM_CAP_SET_CALLBACK_STATUS WM_CAP_SET_CALLBACK_STATUSA#endif#define WM_CAP_SET_CALLBACK_YIELD (WM_CAP_START+ 4)#define WM_CAP_SET_CALLBACK_FRAME (WM_CAP_START+ 5)#define WM_CAP_SET_CALLBACK_VIDEOSTREAM (WM_CAP_START+ 6)#define WM_CAP_SET_CALLBACK_WAVESTREAM (WM_CAP_START+ 7)#define WM_CAP_GET_USER_DATA (WM_CAP_START+ 8)#define WM_CAP_SET_USER_DATA (WM_CAP_START+ 9)#define WM_CAP_DRIVER_CONNECT (WM_CAP_START+ 10)#define WM_CAP_DRIVER_DISCONNECT (WM_CAP_START+ 11)#define WM_CAP_DRIVER_GET_NAMEA (WM_CAP_START+ 12)#define WM_CAP_DRIVER_GET_VERSIONA (WM_CAP_START+ 13)#define WM_CAP_DRIVER_GET_NAMEW (WM_CAP_UNICODE_START+ 12)#define WM_CAP_DRIVER_GET_VERSIONW (WM_CAP_UNICODE_START+ 13)#ifdef UNICODE#define WM_CAP_DRIVER_GET_NAME WM_CAP_DRIVER_GET_NAMEW#define WM_CAP_DRIVER_GET_VERSION WM_CAP_DRIVER_GET_VERSIONW#else#define WM_CAP_DRIVER_GET_NAME WM_CAP_DRIVER_GET_NAMEA#define WM_CAP_DRIVER_GET_VERSION WM_CAP_DRIVER_GET_VERSIONA#endif#define WM_CAP_DRIVER_GET_CAPS (WM_CAP_START+ 14)#define WM_CAP_FILE_SET_CAPTURE_FILEA (WM_CAP_START+ 20)#define WM_CAP_FILE_GET_CAPTURE_FILEA (WM_CAP_START+ 21)#define WM_CAP_FILE_SAVEASA (WM_CAP_START+ 23)#define WM_CAP_FILE_SAVEDIBA (WM_CAP_START+ 25)#define WM_CAP_FILE_SET_CAPTURE_FILEW (WM_CAP_UNICODE_START+ 20)#define WM_CAP_FILE_GET_CAPTURE_FILEW (WM_CAP_UNICODE_START+ 21)#define WM_CAP_FILE_SAVEASW (WM_CAP_UNICODE_START+ 23)#define WM_CAP_FILE_SAVEDIBW (WM_CAP_UNICODE_START+ 25)#ifdef UNICODE#define WM_CAP_FILE_SET_CAPTURE_FILE WM_CAP_FILE_SET_CAPTURE_FILEW#define WM_CAP_FILE_GET_CAPTURE_FILE WM_CAP_FILE_GET_CAPTURE_FILEW#define WM_CAP_FILE_SAVEAS WM_CAP_FILE_SAVEASW#define WM_CAP_FILE_SAVEDIB WM_CAP_FILE_SAVEDIBW#else#define WM_CAP_FILE_SET_CAPTURE_FILE WM_CAP_FILE_SET_CAPTURE_FILEA#define WM_CAP_FILE_GET_CAPTURE_FILE WM_CAP_FILE_GET_CAPTURE_FILEA#define WM_CAP_FILE_SAVEAS WM_CAP_FILE_SAVEASA#define WM_CAP_FILE_SAVEDIB WM_CAP_FILE_SAVEDIBA#endif// out of order to save on ifdefs#define WM_CAP_FILE_ALLOCATE (WM_CAP_START+ 22)#define WM_CAP_FILE_SET_INFOCHUNK (WM_CAP_START+ 24)#define WM_CAP_EDIT_COPY (WM_CAP_START+ 30)#define WM_CAP_SET_AUDIOFORMAT (WM_CAP_START+ 35)#define WM_CAP_GET_AUDIOFORMAT (WM_CAP_START+ 36)#define WM_CAP_DLG_VIDEOFORMAT (WM_CAP_START+ 41)#define WM_CAP_DLG_VIDEOSOURCE (WM_CAP_START+ 42)#define WM_CAP_DLG_VIDEODISPLAY (WM_CAP_START+ 43)#define WM_CAP_GET_VIDEOFORMAT (WM_CAP_START+ 44)#define WM_CAP_SET_VIDEOFORMAT (WM_CAP_START+ 45)#define WM_CAP_DLG_VIDEOCOMPRESSION (WM_CAP_START+ 46)#define WM_CAP_SET_PREVIEW (WM_CAP_START+ 50)#define WM_CAP_SET_OVERLAY (WM_CAP_START+ 51)#define WM_CAP_SET_PREVIEWRATE (WM_CAP_START+ 52)#define WM_CAP_SET_SCALE (WM_CAP_START+ 53)#define WM_CAP_GET_STATUS (WM_CAP_START+ 54)#define WM_CAP_SET_SCROLL (WM_CAP_START+ 55)#define WM_CAP_GRAB_FRAME (WM_CAP_START+ 60)#define WM_CAP_GRAB_FRAME_NOSTOP (WM_CAP_START+ 61)#define WM_CAP_SEQUENCE (WM_CAP_START+ 62)#define WM_CAP_SEQUENCE_NOFILE (WM_CAP_START+ 63)#define WM_CAP_SET_SEQUENCE_SETUP (WM_CAP_START+ 64)#define WM_CAP_GET_SEQUENCE_SETUP (WM_CAP_START+ 65)#define WM_CAP_SET_MCI_DEVICEA (WM_CAP_START+ 66)#define WM_CAP_GET_MCI_DEVICEA (WM_CAP_START+ 67)#define WM_CAP_SET_MCI_DEVICEW (WM_CAP_UNICODE_START+ 66)#define WM_CAP_GET_MCI_DEVICEW (WM_CAP_UNICODE_START+ 67)#ifdef UNICODE#define WM_CAP_SET_MCI_DEVICE WM_CAP_SET_MCI_DEVICEW#define WM_CAP_GET_MCI_DEVICE WM_CAP_GET_MCI_DEVICEW#else#define WM_CAP_SET_MCI_DEVICE WM_CAP_SET_MCI_DEVICEA#define WM_CAP_GET_MCI_DEVICE WM_CAP_GET_MCI_DEVICEA#endif#define WM_CAP_STOP (WM_CAP_START+ 68)#define WM_CAP_ABORT (WM_CAP_START+ 69)#define WM_CAP_SINGLE_FRAME_OPEN (WM_CAP_START+ 70)#define WM_CAP_SINGLE_FRAME_CLOSE (WM_CAP_START+ 71)#define WM_CAP_SINGLE_FRAME (WM_CAP_START+ 72)#define WM_CAP_PAL_OPENA (WM_CAP_START+ 80)#define WM_CAP_PAL_SAVEA (WM_CAP_START+ 81)#define WM_CAP_PAL_OPENW (WM_CAP_UNICODE_START+ 80)#define WM_CAP_PAL_SAVEW (WM_CAP_UNICODE_START+ 81)#ifdef UNICODE#define WM_CAP_PAL_OPEN WM_CAP_PAL_OPENW#define WM_CAP_PAL_SAVE WM_CAP_PAL_SAVEW#else#define WM_CAP_PAL_OPEN WM_CAP_PAL_OPENA#define WM_CAP_PAL_SAVE WM_CAP_PAL_SAVEA#endif#define WM_CAP_PAL_PASTE (WM_CAP_START+ 82)#define WM_CAP_PAL_AUTOCREATE (WM_CAP_START+ 83)#define WM_CAP_PAL_MANUALCREATE (WM_CAP_START+ 84)// Following added post VFW 1.1#define WM_CAP_SET_CALLBACK_CAPCONTROL (WM_CAP_START+ 85)// Defines end of the message range#define WM_CAP_UNICODE_END WM_CAP_PAL_SAVEW#define WM_CAP_END WM_CAP_UNICODE_END