View Full Version : .SendKeys using Windows Key (All)
Simple question:
Using the .SendKeys method, how do you call the 'windows key' on a keyboard?
*******
* g707 *
*******
Still no luck on finding answer on this one... Anyone out there know this one?
*******
* g707 *
*******
"Sendkeys" sends keystrokes to the active window. The "Windows" key does not go to a window, it goes to the operating system.
Remember CTRL + ESC?
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "^{ESC}"
Set WshShell = Nothing
Jama
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).
What exactly are you trying to achieve? There might be a way around the WinKey limitation!
Jama
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.