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 / C++ / MFC
  4. Capturing keyboard input from inside a background WMP9 COM plugin?

Capturing keyboard input from inside a background WMP9 COM plugin?

Scheduled Pinned Locked Moved C / C++ / MFC
comdesignquestion
5 Posts 3 Posters 0 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.
  • I Offline
    I Offline
    IGx89
    wrote on last edited by
    #1

    I've written a background UI COM plugin for WMP9 that does some neat stuff, but I've been hobbled somewhat by the apparent lack of a way to respond to keyboard commands. No way I've tried has worked, including creating a worker thread and calling GetAsyncKeyState. Is there something that I might be missing, or will I have to resort to keyboard hook (like "An All-Purpose Keyboard Hooker")?

    M B 2 Replies Last reply
    0
    • I IGx89

      I've written a background UI COM plugin for WMP9 that does some neat stuff, but I've been hobbled somewhat by the apparent lack of a way to respond to keyboard commands. No way I've tried has worked, including creating a worker thread and calling GetAsyncKeyState. Is there something that I might be missing, or will I have to resort to keyboard hook (like "An All-Purpose Keyboard Hooker")?

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      WMP should call your IWMPPluginUI::TranslateAccelerator() method, that's when you can check the key that was pressed and act on it if you want to. --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- "Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer."   -- Michael P. Butler in the Lounge

      I 1 Reply Last reply
      0
      • M Michael Dunn

        WMP should call your IWMPPluginUI::TranslateAccelerator() method, that's when you can check the key that was pressed and act on it if you want to. --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- "Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer."   -- Michael P. Butler in the Lounge

        I Offline
        I Offline
        IGx89
        wrote on last edited by
        #3

        That was the first thing I tried: that function is never called! To see for yourself if you want, use the wizard and make a UI/Background plugin for WMP. It's never called, possibly because it's a "background" plugin?

        1 Reply Last reply
        0
        • I IGx89

          I've written a background UI COM plugin for WMP9 that does some neat stuff, but I've been hobbled somewhat by the apparent lack of a way to respond to keyboard commands. No way I've tried has worked, including creating a worker thread and calling GetAsyncKeyState. Is there something that I might be missing, or will I have to resort to keyboard hook (like "An All-Purpose Keyboard Hooker")?

          B Offline
          B Offline
          Blake Miller
          wrote on last edited by
          #4

          Not knowing anything about WMP9, but could you possibly hijack the window message handler for the main application window to intercept all the messages it is getting? You could respond to the ones you wanted and call the regular window handler for those you did not want?

          I 1 Reply Last reply
          0
          • B Blake Miller

            Not knowing anything about WMP9, but could you possibly hijack the window message handler for the main application window to intercept all the messages it is getting? You could respond to the ones you wanted and call the regular window handler for those you did not want?

            I Offline
            I Offline
            IGx89
            wrote on last edited by
            #5

            I have no idea how I'd go about doing that, though; my plugin never gets a HWND. I've actually worked around the no-hotkey problem by intuitively tying the function (don't skip this commercial) to the seekbar: if the user seeks twice inside a section containing a commercial within a few seconds, that commercial section is internally ignored.

            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