cancel
Showing results for 
Search instead for 
Did you mean: 

Mouse Move Event Outside vi

Vasanth
Member

Mouse Move Event Outside vi

Hello Everyone,
 
                I need to detect the mouse move event outside a vi. Whenever I move mouse on any part of the screen, I should detect it in a vi that may even run minimised. Please give your suggestions.
 
Thanks,
Vasanth.
Ya Ya
14 REPLIES 14
Andrey_Dmitriev
Trusted Enthusiast

Re: Mouse Move Event Outside vi

Message contains an image Message contains an attachment
Hi, Ya Ya,

You can use Acquire Input Data.vi like shown on the screenshot below:

VI also in attachment (LV 8.2)

best regards,

Andrey.
Vasanth
Member

Re: Mouse Move Event Outside vi

        Thank you Mr.Andrey. I need to know whether the mouse have moved or not. How can I know that? Is there any event available for that?
 
Thanks,
Vasanth.
Ya Ya
Andrey_Dmitriev
Trusted Enthusiast

Re: Mouse Move Event Outside vi

Message contains an image Message contains an attachment
Hi,
 
I'm not sure that you will be able to get mouse event within VI without polling.
Theoretically you must create Hook-DLL, which will collect mouse activities and then will set occurence in LabVIEW. Relative complicated...
But if you need event, then you can fire event programmatically as shown on the screenshot below:
best regards,
 
Andrey.
Vasanth
Member

Re: Mouse Move Event Outside vi

Andrey,
 
            That is great! This is what I exactly wanted to do. Thanks for your help.
 
Thanks,
Vasanth.
Ya Ya
Highlighted
Vasanth
Member

Re: Mouse Move Event Outside vi

Andrey,
 
           Is there a way I can capture this event in the OS level? i.e, directly registering the OS level event onto LabVIEW user event?
 
Thanks,
Vasanth.
Ya Ya
TCPlomp
Trusted Enthusiast

Re: Mouse Move Event Outside vi

Yes You can,

you should find the .net event for the mouse movement and create a callback VI which will react on the .net event

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Andrey_Dmitriev
Trusted Enthusiast

Re: Mouse Move Event Outside vi

Ton,

Good idea, but I'm not sure that its can be done only with .net, because the .net Framework provides no built-in facilities to handle hooks.

But if you will found the .net event, please post example. Its a very interesting for me too. Thanks!

Andrey.

Vasanth
Member

Re: Mouse Move Event Outside vi

Message contains a hyperlink
Check this site in the NI website that instructs how to handle the windows messages in LabVIEW
 
 
Ya Ya
Vasanth
Member

Re: Mouse Move Event Outside vi

Though this helps only for handling the mouse messages over the specified VI.

Thanks,

Vasanth.

Ya Ya