Old 1st October 2009, 11:01   #1
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw
Finding the Winamp window

I can find the Winamp window with the

FindWindow(L"Winamp v1.x", NULL);

function, but there are some weird things, when Winamp isn't running, for example it doesn't return 0, but it returns the window handle of other players, such as AIMP or KMP. Did these players created their windows with this class to get Winamp messages? How can I be sure it's the Winamp window? Is there anything simpler than sending some Winamp specific message to this returned windows handle, and check for answer?
TheSaw is offline   Reply With Quote
Old 3rd October 2009, 08:26   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
there are quite a few other programs which replicate Winamp's main window so they can fool plugins/other plugins to think that they're working with a 'real' Winamp.

checking if it is the real winamp or isn't is tricky as the 'fake' Winamp's should be replicating most of the api so that such checks should become tricky.

i did have a trick for something else which may work of looking for a a "Winamp PE" window class and then getting the owner of that window to get the Winamp window. that is the only thing i can think off currently as i doubt any of the fake instances of Winamp would create that window. there is also the vis window which is a child of the main window as well that i guess could be used as well.

does beg the question of why you need to determine something like that (going on the plugin that i know you're working on unless this is for something else)...

-daz
DrO is offline   Reply With Quote
Old 3rd October 2009, 13:10   #3
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw
I need this because I've added some tasks to the jump list, which need to interact with the Winamp window, but those only execute a system link (a file, or smth), not a code in my application. So since I have no idea how to do it otherwise, I exported a function from my .dll, and set the target of the shell link in the jump list to "rundll32.exe my.dll,myfunc", so when a user clicks on it, a function from my .dll is called, which will search for Winamp window, and sends the necessary messages. This works fine, however the tasks are available even when Winamp isn't open, so this way the window finding doesn't fail, but it returns other dummy windows

Okay, about your solution, what happens if there is no playlist or vis window open? Are they created anyways but set invisible?

Winamp integration plug-in with Windows 7

If you like this plug-in, why not buy me a coffee to keep me awake to work more on it?

TheSaw is offline   Reply With Quote
Old 3rd October 2009, 13:51   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
that makes sense, had to ask as the request seemed strange with respect to a standard plugin.

FindWindow("Winamp PE",0) or FindWindow("WinampVis",0) should work irrespective of the visible state of the playlist or the main window (the vis i'm refering to is the vis area in the main window with classic skins).

-daz
DrO is offline   Reply With Quote
Old 3rd October 2009, 14:27   #5
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw
Okay, this did the trick, thanks.

Winamp integration plug-in with Windows 7

If you like this plug-in, why not buy me a coffee to keep me awake to work more on it?

TheSaw is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump