Just wondering if there is an easy way to handle key presses such as the F keys, i mean when my app doesnt have focus.
or is it similar to the vb6 method? :)
Printable View
Just wondering if there is an easy way to handle key presses such as the F keys, i mean when my app doesnt have focus.
or is it similar to the vb6 method? :)
I cannot imagine a way to handle KeyPress when you app doesn't have focus. Since the app doesn't have focus, the app itself cannot process them. If you really need to handle this due to having multiple forms that interact with each other, etc. then you would have to go the API route.
Is the form that will have focus part of your application or another application all together? Is it in the same executable?
i've done it in vb6 many times, for example, your app is running in the background (system tray), and you hit F2 and it shows up. Just curious if M$ implemented an easy way to have a sub called when F2 is pressed, but I guess the quickest is the old way like vb6
As far as I know using an API is still the only way to handle this. I can't recall which API it is off the top of my head though.
RegisterHotkey
yea RegisterHotKey was the one i was going to use if there was nothing shorter, thanks
Here is something else you might want to look into:
http://www.vbaccelerator.com/home/NE...rm/article.asp
(Download the code at the top left of the page)