i want to try and add a lil bit of somthing to the WM_PAINT, ie, i wanna overwrite the standard win32 ghey gray windows.. with somthing a lil more nice looking, but with what i have at the min... it just locks the window up...
#include "../SDK/foobar2000.h"
LRESULT CALLBACK nWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
HWND foowind;
WNDPROC oldProcAddr;
class startup_main : public initquit
{
public:
virtual void on_init();
virtual void on_quit();
};
void startup_main::on_init() {
foowind = FindWindow("FOOBAR2000_CLASS",NULL);
oldProcAddr = (WNDPROC)SetWindowLong(foowind,GWL_WNDPROC,(long)nWndProc);
InvalidateRect(foowind, NULL, TRUE);
}
void startup_main::on_quit() {
SetWindowLong(foowind,GWL_WNDPROC,(long)oldProcAddr);
}
LRESULT CALLBACK nWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch(uMsg) {
case WM_PAINT: {
HDC hdc;
hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN);
//paint code will end up here
ReleaseDC(hwnd, hdc);
CallWindowProc(oldProcAddr,hwnd,uMsg,wParam,lParam);
}
break;
default:
CallWindowProc(oldProcAddr,hwnd,uMsg,wParam,lParam);
break;
}
return 1;
}
static service_factory_single_t<initquit,startup_main> foo;
DECLARE_COMPONENT_VERSION("Test","0.0",0)
can anyone see were im going wrong?