Silver
April 22nd, 2007, 12:50
Hi all,
Quick favour please. Could somebody compile the following code then run it on a Vista machine under debug and tell me if they get a "value of esp was not saved" type error:
ChangeWindowMessageFilter is a Vista-only function that MSDN defines as returning a BOOL and taking an int, dword as params (see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/changewindowmessagefilter.asp
)
Yet for the life of me I can't get this silly piece of code to work - it's like I've misdecl'd it when according to the docs, I haven't.
Much appreciated.
Quick favour please. Could somebody compile the following code then run it on a Vista machine under debug and tell me if they get a "value of esp was not saved" type error:
Code:
#define MSGFLT_ADD 1
typedef BOOL (*CHANGEWINDOWMESSAGEFILTER)(UINT message, DWORD dwFlag);
HINSTANCE hUser32 = (HINSTANCE)::LoadLibrary(_T("user32.dll");
CHANGEWINDOWMESSAGEFILTER pfnFilter = (CHANGEWINDOWMESSAGEFILTER)::GetProcAddress(hUser32, _T("ChangeWindowMessageFilter");
pfnFilter(WM_USER + 1, MSGFLT_ADD);
ChangeWindowMessageFilter is a Vista-only function that MSDN defines as returning a BOOL and taking an int, dword as params (see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/changewindowmessagefilter.asp
)
Yet for the life of me I can't get this silly piece of code to work - it's like I've misdecl'd it when according to the docs, I haven't.

Much appreciated.