Jump to content

Can you progromatically press the home key?


Recommended Posts

Guest Gremlin
Posted

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

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

Thank you, it turns out that VK_LWIN is in fact the correct key!

-G

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.