未知窗口中的Mouseclick事件 [英] Mouseclick event in unknown window
问题描述
嗨
我正在研究JAI的视觉系统 - 我正在使用他们的SDK并扩展我的使用示例。
问题是,当我按下一个开始按钮时,我会生成一个带有视频流的窗口 - 我在该窗口上绘制了两个带有一些回调函数的图标。
问题是我需要在该窗口中单击其中一个图标(或只是一个区域) - 但我不知道窗口的名称,所以我该怎么做?
不知道这是否有帮助 - 这是我在视频流上生成叠加图形的地方
Hi
I am working on a vision system by JAI - i am using their SDK and expanding an example to my use.
The problem is that when i press a start button a class i generating a window with the video stream - i have drawn two icons on that window with some callback function.
The problem is that i need to click one of those icons (or just an area) in that window - but i don´t know the name of the window so how do i do that ?
don´t know if this helps - this is where i generate the overlay graphics on the videostream
void myCamera_ViewWindowEventDelegate(CCamera camera, Jai_FactoryWrapper.EIVWCallbackType Type, ref Jai_FactoryWrapper.IVWCallbackValue CallbackValue)
{
switch (Type)
{
case Jai_FactoryWrapper.EIVWCallbackType.J_IVW_CB_USER_DRAW_IMAGE:
{
// Get Graphics object from the Device Context handle passed
Graphics g = graphics.FromHdcInternal(CallbackValue.UserDrawInfoValue.hDeviceContext);
// Create a Solid red pen
Pen redPen = new Pen(Color.Red, 1.0F);
g.DrawLine(redPen, (int)(CallbackValue.UserDrawInfoValue.Width / 2), 0, (int)(CallbackValue.UserDrawInfoValue.Width / 2), (int)(CallbackValue.UserDrawInfoValue.Height - 1));
g.DrawLine(redPen,0, (int)(CallbackValue.UserDrawInfoValue.Height/2), (int)(CallbackValue.UserDrawInfoValue.Width - 1),(int)(CallbackValue.UserDrawInfoValue.Height/2));
Icon newIcon = new Icon("down.ico");
Rectangle rect = new Rectangle(10,10,50,50);
g.DrawIcon(newIcon, rect);
g.DrawEllipse(redPen, (int)(CallbackValue.UserDrawInfoValue.Width / 2) - (circleSize / 2), (int)(CallbackValue.UserDrawInfoValue.Height / 2) - (circleSize / 2), circleSize, circleSize);
}
break;
}
}
推荐答案
除非开发JAI系统的任何人/任何人为您提供API对于SDK中窗口上覆盖区域的回调,我认为您必须定义一个Windows全局系统挂钩,以便您的应用程序可以获得Click。可能值得您向JAI支持发布查询。
请参阅George Mamaladze在CP上关于Global Hooks的经典长篇文章:[ ^ ]。
Unless whoever/whatever develops the JAI system gives you an API for callbacks on overlay regions on their window in their SDK, I think you'll have to define a Windows Global System Hook so your App can get the Click. Probably worth your posting a query to JAI support.
See George Mamaladze's classic long-running article on Global Hooks here on CP: [^].
这篇关于未知窗口中的Mouseclick事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!