|
|
#1 |
|
Junior Member
Join Date: Feb 2005
Location: Japan
Posts: 2
|
How to snap an outside window to winamp?
How to snap an outside window to winamp's windows? I have thought out a way as follows: First, get the handles of all the winamp's windows. Then get the rectangles of these windows. When users move the outside window, compare its rectangle with the rectangles of winamp's windows and snap it if needed. It works well in winamp2.9X. But I have been failed in getting the handles of winamp5's modern skin window. How can I get them? Or is there any better way? And I don't want to use any embedded-into-winamp functions.
|
|
|
|
|
|
#2 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,275
|
When running with a modern skin, the 'classic' main window of winamp is located at 32000,32000 or something like that, i can't check for sure as i'm at work but it's effectively as far off screen as can be done.
the modern skin window has a different window class (basewnd_rootwnd or something close to that, winspy++ or any window spying program should be able to give you the correct classname). since you don't want to use the built in enum function for modern skinned windows (which effectively has to be used via a plugin though it's possible to work around this using the readprocessmemory examples around here) which would allow you to find the correct window handle. otherwise you need to do a general enumeration of the windows in the system until you find a match to the window class found and to then check if it's owned by the original winamp window handle you had -daz |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2005
Location: Japan
Posts: 2
|
if I use the built in enum function for modern skinned windows, how can I find the correct window handle?
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jul 2003
Posts: 248
|
Note to DrO: please remember that the windows' class and name can change with the skin (Modern and MMD3 use different windows names, for instance), making the use of the Windows API very random.
|
|
|
|
|
|
#5 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,275
|
i'm aware that the window titles are different for different modern skins but it's possible to test based on the window classname and/or checking against one of the returned window handles Winamp gives (useful for working around issues when using the /class switch at times)
-daz |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Jul 2003
Posts: 248
|
but, in modern skins, all window classes are the very same (main window, playlist editor, media library, plus some hidden windows with the same title as the visible ones...)
What I would like to see (not for me especially, but for some people out there...) would be a function returning the handle of any window we ask for, working whether we're using freeform or classic skins. For instance, enum WinampWindowType { WWT_MAIN, WWT_PLAYLIST, WWT_MEDIALIB }; HWND GetWinampWindow(WinampWindowType type); I don't have much time to think about it right now (I'm at work), but I think it would be worth implementing. |
|
|
|
|
|
#7 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,275
|
(posting in old threads is fun at times
)with the work i'm doing towards an updated sdk installer to include a few new api's introduced in 5.1, i've come across an api which will allow the detection of the main window in a modern skin (without having the issues of class names/title checks, etc ) will be posted up in a few days but thought i'd bring some closure to the points we mentioned here (oh so long ago )-daz |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|