CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: key presses

  1. #1
    Join Date
    Jun 2001
    Posts
    14

    key presses

    My application is unable to send Pageup/down and Control T/X key combination to a commercial application. Can anyone tell me the virtual key value for the above or do i have to use any special functions to do this.
    thanks


  2. #2
    Join Date
    Sep 2001
    Location
    IL, USA
    Posts
    1,090

    Re: key presses

    Ctrl_T 84 2
    Ctrl_X 88 2
    PageUp 33 0
    PageDown 34 0




  3. #3
    Join Date
    Sep 2001
    Location
    IL, USA
    Posts
    1,090

    Re: key presses

    One way to send the keystrocks you are asking about to the active window is to use SendKeys:
    SendKeys "^T", true 'Ctrl_T
    SendKeys "^X", true 'Ctrl_X
    SendKeys "{PGUP}", true 'PageUP
    SendKeys "{PGDN}", true 'PageDown






  4. #4
    Join Date
    Jun 2001
    Posts
    14

    Re: key presses

    thank you MKSA
    i would also like to kow the values for the control E/O/C/Z/V or the link to where i can find these..


  5. #5
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: key presses

    Go to the Object Browser VBRUN Library and peruse the KeyCodeConstants Class for key code values. They are all there.
    Shift, ALt and Ctrl depends on what function or event you are using at the time such as, the MouseDown event has a "Shift" parameter that describes whether or not Ctrl, Alt and or Shift are depressed.

    John G

  6. #6
    Join Date
    Sep 2001
    Location
    IL, USA
    Posts
    1,090

    Re: key presses

    Ctrl_E 69 2
    Ctrl_O 79 2
    Ctrl_C 67 2
    Ctrl_Z 90 2
    Ctrl_V 86 2




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

Featured