Guest Gremlin Posted January 20, 2004 Report Posted January 20, 2004 I have an app that I want to act like the home key is pressed when it exits, so that if you launch it with a fast dial it'll go back home. The app doesn't display any UI just executes an action and quits. Does anyone know how to do this? thank you -G
Guest maxh2003 Posted January 20, 2004 Report Posted January 20, 2004 You can use keybd_event to programatically press keys. For instance: keybd_event(VK_LSHIFT,0,0,0); keybd_event(VK_LSHIFT,0,KEYEVENTF_KEYUP,0); presses and then releases the left shift key. I think the Home key is either VK_HOME or possibly VK_LWIN...? If not you can find all the VK_ definitions in WINUSER.H.
Guest Gremlin Posted January 21, 2004 Report Posted January 21, 2004 Thank you, it turns out that VK_LWIN is in fact the correct key! -G
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now