PDA

View Full Version : problems with subclassing winamp window


deming
18th September 2006, 04:19
1 : if the skin is "modern" , there seems no approaches to get the proper rect of winamp window
2 : code clip:
if(WinampVersion>0x2000 && SkinIsClassic)
pOrigProc =(WNDPROC)SetWindowLong(pWinampWnd, GWL_WNDPROC,(LONG)HookWinampWnd);

Ok, everything is ok, I can drag the winamp window with my dsp plugin window docking to it, and winamp can work or shut down properly with my dsp plugin working/unworking.

But, when my dsp plugin is working, selecting "none" or other dsp plugin in preference page would cause winamp crash.

deming
18th September 2006, 04:23
The crash of DSP plugin switch would disappear if my plugin work without subclassing

Benski
18th September 2006, 04:27
Originally posted by deming
2 : code clip:
if(WinampVersion>0x2000 && SkinIsClassic)
pOrigProc =(WNDPROC)SetWindowLong(pWinampWnd, GWL_WNDPROC,(LONG)HookWinampWnd);

Ok, everything is ok, I can drag the winamp window with my dsp plugin window docking to it, and winamp can work or shut down properly with my dsp plugin working/unworking.

But, when my dsp plugin is working, selecting "none" or other dsp plugin in preference page would cause winamp crash.

This is because Winamp calls FreeLibrary() on your dsp_* plugin when it's done with it. You could unsubclass in Quit(), but there's no guarantee that someone hasn't subclassed over top of you. What are you trying to do? Maybe there's an alternative to subclassing that could be used.