02-08-2013 09:09 AM
Hi everyone,
I have two open VIs, one filling the whole monitor and one filling only a part of it, floating above the other. The second one is created using VI Scripting and called by the first one. Therefore I don't think I can create an event structure with a mouse down event on that front panel, can I? That's why I was looking for a way to create that event on the first VI's front panel, but since the second front panel is floating above the first one, events are not registered. I also could not find a way to create a mouse event based on the coordinates of the mouse on the desktop. Did I overlook anything or is there another another way to achieve what I want?
Thanks.
02-08-2013 10:03 AM
There are two issues:
However, you can work around the issues in your case with a template. Create a VI which has a configured event structure in it. Open this in your scripting code, select the event structure and Move it to the target (Copy/Paste is far slower). This may destroy the whole purpose of scripting the new code, but hopefully not.
If you are doing much scripting, you may consider using the LabVIEW scripting engine.
02-08-2013 10:08 AM
@LordSnow wrote:
[...] I also could not find a way to create a mouse event based on the coordinates of the mouse on the desktop.[...]
User32.dll has a Mouse_Event property. Access it with a Call Library Function Node. That will get the event done, then just use Acquire Input Data.vi to get the area in which you want the mouse event to happen. There's probably examples in the forums.