How do I send the Windows key useing sendkeys. I thinks it's ascii code is 91.
-Thanks.
Printable View
How do I send the Windows key useing sendkeys. I thinks it's ascii code is 91.
-Thanks.
SOme one must know!:D
Damn, I saw this asked a long time ago. I can't remeber. I can't try this right now, but maybe this?
I'll keep searching thru the threadsCode:SendKeys "(^ESC)"
The Windows key is basically Ctrl+Escape.
And here's the code to call it.
Code:Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As _
Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo _
As Long)
Private Const KEYEVENTF_KEYUP = &H2
Private Sub Command1_Click()
keybd_event vbKeyControl, 0, 0, 0
keybd_event vbKeyEscape, 0, 0, 0
keybd_event vbKeyEscape, 0, KEYEVENTF_KEYUP, 0
keybd_event vbKeyControl, 0, KEYEVENTF_KEYUP, 0
End Sub
Yep, I knew it was control - Escape, I think my syntax was correct, not sure though..
Thanks Matthew Gates
:D
Quote:
Originally posted by Lethal
Damn, I saw this asked a long time ago. I can't remeber. I can't try this right now, but maybe this?
I'll keep searching thru the threadsCode:SendKeys "(^ESC)"
That won't work Lethal, SendKeys is being stubborn :rolleyes:.
Ahh...Sendkeys does act kinda flaky sometimes..Logically it should, but the API is the way 2 go as you mentioned..:)
Does this work
SendKeys "{^ESC}"....If I remember right you need to use these {} when dealing with special keys like tab, enter...etc.
Maybe I'm thinking of something else:rolleyes:
But that doesn't work and niether does the code above.Code:SendKeys "^{ESC}"
Ahhhh...Sendkeys doesn't cover all the keys. I'd go with the API myself. The added benefit is you don't get your "Num Lock" indicator flashing.
Quote:
Originally posted by TiPeRa
I thinks it's ascii code is 91.
-Thanks.
By the way,
Chr(91) = [
:rolleyes:
know who to send ctrl alt del at the same time
You cannot simulate the Ctrl+Alt+Del combination. As I understand, MS made it so this event will only occur if the hardware (keyboard) sends a signal.
sendkeys "^({ESC})"
No, that doesn't work.