PDA

View Full Version : .SendKeys using Windows Key (All)



g707
05-25-2004, 11:34 AM
Simple question:
Using the .SendKeys method, how do you call the 'windows key' on a keyboard?

*******
* g707 *
*******

g707
06-09-2004, 09:49 AM
Still no luck on finding answer on this one... Anyone out there know this one?

*******
* g707 *
*******

Brf
06-09-2004, 10:26 AM
"Sendkeys" sends keystrokes to the active window. The "Windows" key does not go to a window, it goes to the operating system.

Jama
06-09-2004, 03:59 PM
Remember CTRL + ESC?

set WshShell = CreateObject("WScript.Shell")

WshShell.SendKeys "^{ESC}"

Set WshShell = Nothing


Jama

g707
06-11-2004, 07:22 PM
Thanks Jama, but not exactly what I was looking for. I wasn't looking to bring up the Start Menu, instead I wanted to use the hotkeys that can be used with WinKey.

**
Brf, thanks for the explaination.
After searching the web I couldn't find anyone who was able to emulate the WinKey and everyone acknowledged it, but I couldn't find the reason why.

*******
* g707 *
*******

cprasley
06-11-2004, 11:13 PM
The "reason why" is because the BIOS and/or operating system read the keyboard as down/up keyboard scan events, not ASCII characters. The keyboard event handler processes the scan events and determines what to do: to place an ASCII value on the input queue, to perform a special subroutine or to do nothing. If the scan sequence is associated with a special subroutine then the subroutine is called and the application that had the focus is never even aware that a keyboard entry had been made as nothing is placed on the input queue. A classic example is Ctl-Alt-Del. The Windows key is a modern equivalent.

The SendKeys method places ASCII values on the input queue, simulating a case where a set of keyboard scan events had already been interpreted as a regular ASCII character entry. There is no way to simulate keyboard scan events from within WSH (unless you create a custom DLL to make that feature available to your application).

Jama
06-12-2004, 05:35 AM
What exactly are you trying to achieve? There might be a way around the WinKey limitation!


Jama