Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendkeys control escape

Status
Not open for further replies.

crrrazydan

Programmer
Jul 27, 2000
34
US
How do I simulate the control and escape keys being pressed? I already tried Sendkeys "^{esc}" and Sendkeys "^{escape}". What I am trying to do here is bring up the windows start menu, so if there's another way to do that, that would work too.
 
SendKeys keystrokes go to whatever window is active when the command is issued. If your Access window is active (probably true), it doesn't have any command that's initiated by Ctrl-Esc, so it just ignores the keystrokes.

To get this to work, you'd have to activate the TaskBar window, I think. (Although it doesn't look like what you usually think of as a window, it is one; everything on the Windows screen is a window, or part of a window.) Unfortunately, I don't know how you'd do this. It would probably involve a Windows API call, though.

Note: SendKeys is considered a "quick and dirty" way of controlling the Windows environment. Because it's hard to detect or control which window is active at the time you issue the SendKeys command, you can get different results at different times or on different machines. It would be better if you could find an alternate way of doing whatever it is you're doing with SendKeys. Why don't you describe what you need, and maybe we can suggest a safer way of doing it? Rick Sprague
 
What I really want to do is to put the computer on Standby.
NOT shut it down with a shut down API!!!! But, if there was a good way to put a computer on standby mode, or bring up the start menu, i'd really appreciate someone telling me more about it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top