12-10-2010 04:54 AM
Hi all,
I try to register windows hotkey through using user32.dll RegisterHotkey function and get the windows message to process future applications.
My code is attached as follows, and the user32.dll is called in the Register Hotkey and Unregister Hotkey subVI.
This is the Register Hotkey SubVI. The x0 is the hWnd.
This is the Unregister Hotkey SubVI.
The Windows Message Queue Library can be found here.
http://sine.ni.com/devzone/cda/epd/p/id/4394
I don't know why I am not getting any windows message out of this scenario, even though the RegisterHotkey function seems to work.
Please provide some suggestion for this application.
Thank you
Bboyz
12-14-2010 04:08 AM
Seems nobody know the answer.....@@...
12-14-2010 09:23 AM
In this particular case it would be better if you posted the actual VIs so your Call Library Function Nodes can be inspected. You do not need to upload the library VIs, as those can be downloaded directly. Be sure to upload the subVIs you created.
12-14-2010 10:47 AM
Hi,
The Main VI and the subVI are here.
Please help me to check if the Call Library Function Node can work properly.
Thank you
12-14-2010 01:25 PM
I think the problem you have is that the Message Queue library is written to create a message queue tied to a window. It does not see messages that are "global" in nature. Thus, you'd have to do a RegisterHotKey and specify the window refnum of your main VI's window.
01-01-2011 09:11 AM
Hi Smercurio,
I don't have the idea of how to get the windows procedures.
I realized that the reason it didn't work was because of the function of windows procedure is not properly declared.
Here are some example codes.
http://www.developerfusion.com/code/271/create-a-hot-key/
http://www.vb-helper.com/howto_hotkey.html
Both of them were utilizing CallWindowProc lib, but I really don't know how to use it in LabVIEW.
Could you give me some more idea about my application?
Actually, I want to make the hotkey function global, but not only within the main VI.
Thank you for your reply.
Ting