#1  
Old 05-25-2004, 10:34 AM
g707 g707 is offline
Member
 
Join Date: Jul 2001
Location: California, USA
Posts: 47
Default .SendKeys using Windows Key (All)

Simple question:
Using the .SendKeys method, how do you call the 'windows key' on a keyboard?

*******
* g707 *
*******
Reply With Quote
  #2  
Old 06-09-2004, 08:49 AM
g707 g707 is offline
Member
 
Join Date: Jul 2001
Location: California, USA
Posts: 47
Default Re: .SendKeys using Windows Key (All)

Still no luck on finding answer on this one... Anyone out there know this one?

*******
* g707 *
*******
Reply With Quote
  #3  
Old 06-09-2004, 09:26 AM
Brf Brf is offline
Expert
 
Join Date: Jul 2003
Posts: 1,595
Default Re: .SendKeys using Windows Key (All)

"Sendkeys" sends keystrokes to the active window. The "Windows" key does not go to a window, it goes to the operating system.

Reply With Quote
  #4  
Old 06-09-2004, 02:59 PM
Jama Jama is offline
Advisor
Moderator
 
Join Date: Mar 2002
Location: London, UK
Posts: 339
Default Re: .SendKeys using Windows Key (All)


Remember CTRL + ESC?

set WshShell = CreateObject("WScript.Shell")

WshShell.SendKeys "^{ESC}"

Set WshShell = Nothing


Jama
Reply With Quote
  #5  
Old 06-11-2004, 06:22 PM
g707 g707 is offline
Member
 
Join Date: Jul 2001
Location: California, USA
Posts: 47
Default Re: .SendKeys using Windows Key (All)

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 *
*******
Reply With Quote
  #6  
Old 06-11-2004, 10:13 PM
cprasley cprasley is offline
Enthusiast
 
Join Date: Feb 2002
Posts: 65
Default Re: .SendKeys using Windows Key (All)

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).

Reply With Quote
  #7  
Old 06-12-2004, 04:35 AM
Jama Jama is offline
Advisor
Moderator
 
Join Date: Mar 2002
Location: London, UK
Posts: 339
Default Re: .SendKeys using Windows Key (All)


What exactly are you trying to achieve? There might be a way around the WinKey limitation!


Jama
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:18 AM.