|
|
#1 |
|
Junior Member
|
Toggle EQ & Main
Hello,
Ive figured out how to toggle most windows thanks to the GUID's posted here, but there are still 2 windows that wont toggle... one is EQ.. there is provied this GUID for it but it doesnt work { 0xB66F7CE8, 0x8BB9, 0x4DAF, { 0x95, 0xF5, 0x4C, 0x45, 0xB0, 0x5C, 0xF1, 0xB7 } }; and the other is MainWindow / whole Winamp... to Minimize & Restore Winamp Windows... |
|
|
|
|
#2 |
|
Member
Join Date: Mar 2003
Posts: 52
|
I use this to minimize the main window:
HWND hwndWinamp = GetParent( GetParent( this->getRootParent()->gethWnd() ) ); ShowWindow( hwndWinamp, SW_MINIMIZE ); A bit dirty maybe and if you want to do it using wasabi you shouldn't use this But it works...Hope this helps... |
|
|
|
|
#3 |
|
Junior Member
|
in what class do you call that function ? ie. what is 'this' ?
|
|
|
|
|
#4 |
|
Member
Join Date: Mar 2003
Posts: 52
|
this = my own class derived from BaseWnd.
The window that my plugin is running in. |
|
|
|
|
#5 |
|
Junior Member
|
Ok,
the problem is that I dont create any parent windows to Winamp.. is there any other way to retrive winamp handle thru the api's? |
|
|
|
|
#6 |
|
Member
Join Date: Mar 2003
Posts: 52
|
Found this in bfc/msgbox.cpp:
sw = new SkinWnd("msgbox.custom.group", "modal", FALSE, NULL, 1, 1); if (!sw->getWindow()) return -1; RootWnd *grp = sw->getWindow(); RootWnd *l = grp->getDesktopParent(); I didn't test it, but that RootWnd *l might be the winamp main window.. Otherwise I don't know
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jul 2002
Location: The holy land
Posts: 227
|
use api->main_getRootWnd()
yonido |
|
|
|
|
#8 |
|
Junior Member
Join Date: Apr 2003
Posts: 6
|
It seems more than reasonable that
should give you the main application window that you can then minimize, but it doesn't. It gives you a hidden window with a class of "BaseWindow_RootWnd", a name of "", located at (0, 0), and with a size of 320x200. This mysterious window has no Wasabi window parent, and no MSWindows parent or owner handle. Of all of the open Winamp3 windows, hidden or otherwise, it is the only window not owned by the actual application main window.code: The actual Winamp3 application main window has a class of "STUDIO", a name of "Winamp3" (This is the OS window name and not the name you actually see in the main window), and a location and size matching the visible main window. It is the handle of this window that you need to use in a ::ShowWindow(hWnd, SW_MINIMIZE) call. In Winamp3 Wasabi, if you have created a window, you can get the application window handle as follows: Using this handle in a ::ShowWindow(hWnd, SW_MINIMIZE) call will minimize the application.code: If you do not create a window, then you've got a problem. I can find no other ComponentAPI function that will get you a window that has the application main window as the owner. One solution is to enumerate all the top-level windows for the current thread (in case there is more than one instance of Winamp3 running) and compare the class name to the known Winamp3 application main window class name. Like so: This code code: uses this callback function code: Both of these were tested on Winamp3 #488 (Wow! A submitted answer that was actually tested! ). Note that this is not platform independent, and it depends on the application main window class name remaining "STUDIO" through future versions. Not a good thing, but it works for now.I don't know why the window we get from api->main_getRootWnd() is not the application main window nor why it is not at least owned by that window. Maybe one of the core engineers would like to enlighten as to why, if this is simply a bug, or if there is some other way to manipulate the application main window (Everybody hold your breath now <chuckle>). I hope this is of some help. |
|
|
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|