Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Re: trapping F1 in a file dialog

Re: trapping F1 in a file dialog

Scheduled Pinned Locked Moved C#
csharpvisual-studioalgorithmshelpquestion
7 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mla154
    wrote on last edited by
    #1

    Hello, I'm using C# in Visual Studio 2008. Is it possible to trap the F1 key in a file dialog (Open or 'Save As')? I've been searching on the internet for the answer to this but I've found none. Any help is appreciated. Regards, Mike

    D 1 Reply Last reply
    0
    • M mla154

      Hello, I'm using C# in Visual Studio 2008. Is it possible to trap the F1 key in a file dialog (Open or 'Save As')? I've been searching on the internet for the answer to this but I've found none. Any help is appreciated. Regards, Mike

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      Although I have never done this, my first thought is GetActiveWindow + Global keyboard hook.

      M 1 Reply Last reply
      0
      • D dan sh

        Although I have never done this, my first thought is GetActiveWindow + Global keyboard hook.

        M Offline
        M Offline
        mla154
        wrote on last edited by
        #3

        d@nish, I'm not sure about the GetActiveWindow, but I found a global keyboard hook program. Everything appears to be working now. Thank you for your help. Regards, Mike

        D D 2 Replies Last reply
        0
        • M mla154

          d@nish, I'm not sure about the GetActiveWindow, but I found a global keyboard hook program. Everything appears to be working now. Thank you for your help. Regards, Mike

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Really? You might want to see what happens in your app while its running and the user switches to another app and hits F1.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008
          But no longer in 2009...

          M 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Really? You might want to see what happens in your app while its running and the user switches to another app and hits F1.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008
            But no longer in 2009...

            M Offline
            M Offline
            mla154
            wrote on last edited by
            #5

            Dave, What happened when you did this? Regards, Mike -- Modified Tuesday, June 15, 2010 11:45 AM

            D 1 Reply Last reply
            0
            • M mla154

              d@nish, I'm not sure about the GetActiveWindow, but I found a global keyboard hook program. Everything appears to be working now. Thank you for your help. Regards, Mike

              D Offline
              D Offline
              dan sh
              wrote on last edited by
              #6

              It is "global keyboard hook". That will work regardless of the active window. So, if you have a notepad and your application running, and user presses F1 in the notepad, still the code in your application will fire. That is why I said GetActiveWindow + global keyboard hook. You should check in which window is that F1 key pressed and then process it.

              1 Reply Last reply
              0
              • M mla154

                Dave, What happened when you did this? Regards, Mike -- Modified Tuesday, June 15, 2010 11:45 AM

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Remember, that's a GLOBAL keyboard hook, that means SYSTEM GLOBAL, not application. If the users hits that key, while your app is running, in ANY application or Explorer window, it'll fire in your application. Is that what you want it to do??

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008
                But no longer in 2009...

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups