Postmessage Not Working With WH_GETMESSAGE-MFC
-
Hi, I Have Installed A Hook With WH_GETMESSAGE On A DLL Using MFC.But When I Send Postmessage To My Parent Window It Is Not Received...
HWND hwndmain; //(Assigned The Value Of Main Window HWND)
static UINT snd=::RegisterWindowMessage(L"mainwnd_msg");
::PostMessage(hwndmain,snd,0,0);
The Same Message Is Declared In The Main Window To Receive The Registered Window Message And Added On register message event also But It Is Not Working Kindly Help Me I'm Not Able To Find What Is Happenning...
-
Hi, I Have Installed A Hook With WH_GETMESSAGE On A DLL Using MFC.But When I Send Postmessage To My Parent Window It Is Not Received...
HWND hwndmain; //(Assigned The Value Of Main Window HWND)
static UINT snd=::RegisterWindowMessage(L"mainwnd_msg");
::PostMessage(hwndmain,snd,0,0);
The Same Message Is Declared In The Main Window To Receive The Registered Window Message And Added On register message event also But It Is Not Working Kindly Help Me I'm Not Able To Find What Is Happenning...
-
The
RegisterWindowMessage
function is for sharing a message between different applications. For user messages in a single application see RegisterWindowMessageA function | Microsoft Docs[^].Thank you For Your Reply,But My Problem Is I Have Installed A WH_GETMESSAGE Hook In a DLL.The DLL Is Loaded On To Notepad Process.The DLL Will Post The Message To Mainwindow When Key 'A' Is Pressed.The Main Window(HWND) Which Has Triggered The Hook Is Unable To Receive The "Postmessage" Posted To It.But Notepad(HWND) Is Able To receive The Postmessage Posted To It...
-
Thank you For Your Reply,But My Problem Is I Have Installed A WH_GETMESSAGE Hook In a DLL.The DLL Is Loaded On To Notepad Process.The DLL Will Post The Message To Mainwindow When Key 'A' Is Pressed.The Main Window(HWND) Which Has Triggered The Hook Is Unable To Receive The "Postmessage" Posted To It.But Notepad(HWND) Is Able To receive The Postmessage Posted To It...
-
Thank you For Your Reply,But My Problem Is I Have Installed A WH_GETMESSAGE Hook In a DLL.The DLL Is Loaded On To Notepad Process.The DLL Will Post The Message To Mainwindow When Key 'A' Is Pressed.The Main Window(HWND) Which Has Triggered The Hook Is Unable To Receive The "Postmessage" Posted To It.But Notepad(HWND) Is Able To receive The Postmessage Posted To It...
First PostMessage returns a result and check the value of the message handle before the dispatch ... act like a programmer, you can easily give us a hell of a lot more information than you have. At a guess the window you are sending it to is not active or the window you are trying to post from is a dialog in the modal state. Can't tell much beyond that you haven't explained or given us enough detail.
In vino veritas