avicap32.dll WM_CAP_DRIVER_CONNECT问题 [英] avicap32.dll WM_CAP_DRIVER_CONNECT problem
问题描述
亲爱的
我对WM_CAP_DRIVER_CONNECT消息有疑问.
仅在系统重新启动后(Windows 7 x64),它才第一次工作.同时,它始终可以在与我的机器完全相同的另一台机器上正常工作.
请在下面的代码示例中找到.
公共无效的Attach(System.Windows.Forms.Control控件)
{
deviceHandle = Avicap32.capCreateCaptureWindow(",Constants.WS_VISIBLE | Constants.WS_CHILD,0,0,control.Width,control.Height,control.Handle,0);
如果(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);
}
其他
{
MessageBox.Show("糟糕!);
}
}
>
public void Detach()
{
如果(deviceHandle.ToInt32()!= 0)
{
User32.SendMessage(deviceHandle,Constants.WM_CAP_DRIVER_DISCONNECT,(IntPtr)deviceNumber,(IntPtr)0);
User32.DestroyWindow(deviceHandle);
}
deviceHandle = new IntPtr(0);
}
>
我尝试了其他几个示例,但问题始终相同-第一次成功运行后,WM_CAP_DRIVER_CONNECT失败.
问题出在哪里?如何解决?
谢谢!
其他详细信息:当消息无法连接时,它将显示对话窗口视频源".带有仅包含一项的下拉列表-我的内置网络摄像头.无论如何,即使选择了该项目也不起作用.
Alex0704
欢迎使用MSDN论坛支持.
我们正在对此问题进行研究.我们可能需要一些时间才能回复您.
真诚的
贾森·王(Jason Wang)
Dears
I 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 advance
Additional 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问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!