我尝试了其他几个示例,但问题始终相同-第一次成功运行后,WM_CAP_DRIVER_CONNECT失败.问题出在哪里?如何解决? 谢谢! 其他详细信息:当消息无法连接时,它将显示对话窗口视频源".带有仅包含一项的下拉列表-我的内置网络摄像头.无论如何,即使选择了该项目也不起作用.解决方案 Alex0704 欢迎使用MSDN论坛支持. 我们正在对此问题进行研究.我们可能需要一些时间才能回复您. 真诚的 贾森·王(Jason Wang) DearsI have a problem with WM_CAP_DRIVER_CONNECT message.It works only 1st time after system restart only (Windows 7 x64). Meanwhile it works fine always on another machine which is completely the same as mine. Please find below the example of code.public void Attach(System.Windows.Forms.Control control)        {            deviceHandle = Avicap32.capCreateCaptureWindow("", Constants.WS_VISIBLE | Constants.WS_CHILD, 0, 0, control.Width, control.Height, control.Handle, 0);            if (User32.SendMessage(deviceHandle, Constants.WM_CAP_DRIVER_CONNECT, (IntPtr)deviceNumber, (IntPtr)0).ToInt32() > 0)            {                User32.SendMessage(deviceHandle, Constants.WM_CAP_SET_SCALE, (IntPtr)(-1), (IntPtr)0);                User32.SendMessage(deviceHandle, Constants.WM_CAP_SET_PREVIEWRATE, (IntPtr)0x42, (IntPtr)0);                User32.SendMessage(deviceHandle, Constants.WM_CAP_SET_PREVIEW, (IntPtr)(-1), (IntPtr)0);                User32.SetWindowPos(deviceHandle, new IntPtr(0), 0, 0, control.Width, control.Height, 6);            }            else            {                MessageBox.Show("Oops!");            }        }  public void Detach()        {            if (deviceHandle.ToInt32() != 0)            {                User32.SendMessage(deviceHandle, Constants.WM_CAP_DRIVER_DISCONNECT, (IntPtr)deviceNumber, (IntPtr)0);                User32.DestroyWindow(deviceHandle);            }            deviceHandle = new IntPtr(0);        } I have tried several other examples, but the problem is the same always - WM_CAP_DRIVER_CONNECT fails after 1st successful run. Where can be the problem? How to fix it?Thank you in advanceAdditional detail: when the message fails to connect then it shows dialog window "Video source" with drop down list which contains only one item - my build-in web camera. Anyway nothing works even if the item is choosen. 解决方案 Hi Alex0704,  Welcome to MSDN Forum Support.  We're doing research on this issue. It might take some time before we get back to you.  Sincerely,  Jason Wang 这篇关于avicap32.dll WM_CAP_DRIVER_CONNECT问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-23 08:35