As expected: message only window cannot post messages to its "parent". CWnd::PostMessage() invoked on HWND_MESSAGE crashes with access violation:
Links and references:
Message-Only Windows (MSDN)
How to make a Message Only Window
How to create a hidden window in C++
class CMsgOnlyWnd : public CWnd
{
...
public:
Initialize();
SendMsgToParent();
...
}
CMsgOnlyWnd::Initialize()
{
...
CreateEx(0, ::AfxRegisterWndClass(NULL), "MsgOnlyWnd", 0, 0, 0, 0, 0, HWND_MESSAGE, 0, NULL);
...
}
CMsgOnlyWnd::SendMsgToParent()
{
GetParent()->PostMessage(...);
}
{
...
public:
Initialize();
SendMsgToParent();
...
}
CMsgOnlyWnd::Initialize()
{
...
CreateEx(0, ::AfxRegisterWndClass(NULL), "MsgOnlyWnd", 0, 0, 0, 0, 0, HWND_MESSAGE, 0, NULL);
...
}
CMsgOnlyWnd::SendMsgToParent()
{
GetParent()->PostMessage(...);
}
Links and references:
Message-Only Windows (MSDN)
How to make a Message Only Window
How to create a hidden window in C++
No comments:
Post a Comment