CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2011
    Posts
    1

    Question Keyboard Short cuts to open a program?

    I am quite new to the world of programming and i have started to learn C#

    What I wanted to do was have a program that opened a form when i typed a keyboard short cut (e.g. ctrl + J). I think id have to use processes? What would i need to research into to accomplish this?

  2. #2
    Join Date
    Jul 2007
    Location
    Illinois
    Posts
    517

    Re: Keyboard Short cuts to open a program?

    You would need a program that can intercept keystrokes and look for the CTRL+J combination. I'm not sure how, but if you could develop a program that would hook all keystrokes sent to Windows and filter them for CTRL+J, you could do it... this article may help:

    http://support.microsoft.com/kb/320584

    The problem is capturing keystrokes from other processes, that's where the difficulty truly lies
    R.I.P. 3.5" Floppy Drives
    "I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." - Albert Einstein

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Keyboard Short cuts to open a program?

    If you want the form to open when someone presses this key sequence within your own program then that is rather simple. Using the keypreview property of your active form you can intercept keystrokes and have them tigger other code as needed.

    If you are talking about intercepting keystrokes from the destop or other application then that is a bit more of an issue.
    Always use [code][/code] tags when posting code.

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