Results 1 to 16 of 16

Thread: SendKeys

  1. #1

    Thread Starter
    Hyperactive Member TiPeRa's Avatar
    Join Date
    Apr 2001
    Location
    In between
    Posts
    464

    Unhappy SendKeys

    How do I send the Windows key useing sendkeys. I thinks it's ascii code is 91.
    -Thanks.
    W#Ć€V€® W¦|| ߀ W¦|| ߀, ÄÑÐ †#€®€ ¦§ ÑÖ†#¦Ñ6 ¥Öµ ©ÄÑ ÐÖ ÄßÖµ† ¦†, §Ö §¦† ßÄ©K, ®€|ÄX ÄÑÐ |€† ¦† #ÄÞÞ€Ñ.
    (Whatever will be will be, and there is nothing you can do about it, so sit back, relax and let it happen.)

  2. #2

    Thread Starter
    Hyperactive Member TiPeRa's Avatar
    Join Date
    Apr 2001
    Location
    In between
    Posts
    464
    SOme one must know!
    W#Ć€V€® W¦|| ߀ W¦|| ߀, ÄÑÐ †#€®€ ¦§ ÑÖ†#¦Ñ6 ¥Öµ ©ÄÑ ÐÖ ÄßÖµ† ¦†, §Ö §¦† ßÄ©K, ®€|ÄX ÄÑÐ |€† ¦† #ÄÞÞ€Ñ.
    (Whatever will be will be, and there is nothing you can do about it, so sit back, relax and let it happen.)

  3. #3
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Damn, I saw this asked a long time ago. I can't remeber. I can't try this right now, but maybe this?

    Code:
      SendKeys "(^ESC)"
    I'll keep searching thru the threads

  4. #4
    Matthew Gates
    Guest
    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

  5. #5
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Yep, I knew it was control - Escape, I think my syntax was correct, not sure though..

  6. #6

    Thread Starter
    Hyperactive Member TiPeRa's Avatar
    Join Date
    Apr 2001
    Location
    In between
    Posts
    464
    Thanks Matthew Gates
    W#Ć€V€® W¦|| ߀ W¦|| ߀, ÄÑÐ †#€®€ ¦§ ÑÖ†#¦Ñ6 ¥Öµ ©ÄÑ ÐÖ ÄßÖµ† ¦†, §Ö §¦† ßÄ©K, ®€|ÄX ÄÑÐ |€† ¦† #ÄÞÞ€Ñ.
    (Whatever will be will be, and there is nothing you can do about it, so sit back, relax and let it happen.)

  7. #7
    Matthew Gates
    Guest
    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?

    Code:
      SendKeys "(^ESC)"
    I'll keep searching thru the threads

    That won't work Lethal, SendKeys is being stubborn .

  8. #8
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Ahh...Sendkeys does act kinda flaky sometimes..Logically it should, but the API is the way 2 go as you mentioned..

  9. #9
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    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

  10. #10
    Matthew Gates
    Guest
    Code:
    SendKeys "^{ESC}"
    But that doesn't work and niether does the code above.

  11. #11
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    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.

  12. #12
    Matthew Gates
    Guest

    Re: SendKeys

    Originally posted by TiPeRa
    I thinks it's ascii code is 91.
    -Thanks.

    By the way,

    Chr(91) = [


  13. #13
    Hyperactive Member
    Join Date
    Mar 2001
    Location
    United States
    Posts
    420

    does any body...

    know who to send ctrl alt del at the same time

  14. #14
    Megatron
    Guest
    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.

  15. #15
    Hyperactive Member theman32x's Avatar
    Join Date
    May 2000
    Location
    New Jersey, USA
    Posts
    305

    maybe ... ?

    sendkeys "^({ESC})"

  16. #16
    Megatron
    Guest
    No, that doesn't work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width