Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Capturing Key commands, then executing command (http://www.programmingforums.org/showthread.php?t=7345)

slarti Dec 1st, 2005 6:01 PM

Capturing Key commands, then executing command
 
I want to set a function key to execute a command from the cmd in windows XP. I saw an article similar to this at MSDN but I don't think that this is what I need.



http://support.microsoft.com/default...1&PA=1&SD=HSCH

I like the way it is headed, basically detect when a function key is pressed and then perform an action. Can this be done?

Rory Dec 2nd, 2005 1:46 PM

A function key (F1 - F16) has a scan code just like any other, this article is just on capturing presses when an application window has focus. If you want to catch them on a more global level (i.e. when your application does not have focus), you can use DirectInput, windows hotkeys or lower-level keyboard hooks, the latter also allowing you to capture the "action buttons" on media keyboards.

slarti Dec 2nd, 2005 3:13 PM

Thanks for your response. I have just started looking into VB. I am a systems admin with a little web development(php scripting) experience. I find I need to do things that i cannot do with the native admin consoles and would like to learn how to make my own.

Can you recommend a good book on starting Vb that has subjects like this in it?


All times are GMT -5. The time now is 2:32 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC