Capturing keyboard input from inside a background WMP9 COM plugin?
-
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")?
-
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")?
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 -
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'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")?
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?
-
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 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.