I've successfully registered a window class using RegisterClassEx
and created a window using CreateWindowEx
:
m_hInstance = ::GetModuleHandle(NULL);
...
m_hWnd = ::CreateWindowEx(0, "CMyClassName", "Message Window", 0, 0, 0, 0, 0, HWND_MESSAGE, 0, m_hInstance, 0);
The associated window procedure receives messages 36, 129, 131, and 1, and the returned HWND
is not null. However, when I later call PostMessage
(from another thread):
bool bPosted = ::PostMessage(m_hWnd, WM_APP + 3, 0, 0);
even though bPosted is true, the window procedure isn't called. I'm trying to work out why that should be. The window procedure is the one from the MSDN example - I'd intented to add another case once I'd confirmed the messages were getting through.
What conditions need to be fulfilled for a window message to be posted?