|
|
#1 |
|
Senior Member
|
Opening Winamp preferences / Winamp ini dir
2 questions:
1. Currently I'm opening the preferences window with SendMessage(hwnd,WM_WA_IPC,-1,IPC_OPENPREFSTOPAGE); But this doesn't set the window to the foreground. I don't know how to get the Winamp handle, because the title might be in other language, and the class is some generic dialog class... Is there a way to bring it to the foreground when opening? 2. I'm using SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIDIRECTORY); to get the ini directory, but this only sends ansi string, not unicode (which is needed). I've used the winapi function to get the %appdata% folder and it's working fine, just wondering, is Winamp using that folder in every case, or it might use some other directory to store the settings, maybe if it can be installed for all users, not per user? |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Aug 2008
Posts: 114
|
1. well it looks like you are controlling Winamp from an external application. Do it from within a plugin. You could use GetWindowModuleFileName and GetFileVersionInfo to assert it is a real winamp handle.
|
|
|
|
|
|
#3 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,240
|
for #1 then the following api may be of use (though i'm sure there are some changes to Vista/Win7 that may hinder external focusing of a window)
code: for #2, it depends on what is specified in paths.ini (if one is present) and this post/thread has the information needed to get going with things if done from an external dll. griffins_Grader: from previous posts by TheSaw, some of his features have to be done in a shell extension which makes it impossible to do as a true Winamp plugin ![]() -daz |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Aug 2008
Posts: 114
|
DrO, Having mentioned the focus issue with vista/Win7. I have a plugin that draw Windows Controls (ActiveX Controls), when I run this plugin on Win7 the Controls do not get focus with a single click, I have to set focus on the window(ATL Window) containing the Controls then be able to get focus on any of the controls with a single click else I have to double click on the control. Please do you have any reference addressing this issue? I thought about listening on WM_NCHITTEST and when the mouse is on my plugin's window RECT and the plugin's window is the top window then the plugin will set focus to the window but it is somewhat "hacky" I would prefer a standard approach probably from the OS SDK. Regards.
|
|
|
|
|
|
#5 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,240
|
hmm, not too sure unless something else on the dialog is setting focus to itself which causes the effect you're seeing.
from what i remember wm_setfocus/wm_activate are the better message pair to work with for the handling of the window being activated so you can then do a SetFocus(..) on the relevant control. may even be an idea to use something like spy++ to see what messages are going on when the window is being focused to see what/who is doing things. i think the main Vista/Win7 focus issues are down to clamping down on certain cross-process methods which were ideal for viruses/malware though i can't remember how much that would affect things (like with what TheSaw is trying to achieve). TheSaw: had a thought in the reply to griffins_Grader and maybe a PostMessage(hwnd,WM_WA_IPC,-1,IPC_OPENPREFSTOPAGE) will work around the focusing issue (i've a feeling what you're doing forces the focus back to your code which goes against Winamp's preferences opening at the same time). -daz |
|
|
|
|
|
#6 |
|
Senior Member
|
Thx DrO, both solutions work (partially). I say partially, because Winamp's windows are acting weird like all the time, so I can only set it to foreground after waiting 500ms, but it should be okay like this.
For the second solution, I'll post the code snippet I've wrote for parsing the paths.ini file, in case someone else finds all this confusing (like I did). It might not be perfect, but it works ![]() code: |
|
|
|
|
|
#7 |
|
Senior Member
|
As an offtopic question: how can I mute winamp from my plug-in? Not setting the volume to 0, but actually muting it?
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?
|
|
|
|
|
|
#8 |
|
Senior Member
|
And another one: I'm trying to get the path to the inidir/plugins, but the above code doesn't work for everyone. I'm parsing it from the paths.ini, and if it's not readable, I use installdir/plugins, but that's not the right path.
Basically I want to get the same thing as the return of the IPC_GETINIDIRECTORY message, but wide string. 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?
|
|
|
|
|
|
#9 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,240
|
i don't think there is a way to mute winamp - even it's mute feature just sets the volume in Winamp itself to zero.
the plugins directory should be %winampdir%\plugins unless people have multiple winamp installs... there is a registry setting for the uninstaller which holds the path of the last valid install (is generally safe to use that) -> HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp -> UninstallString. -daz |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|