i am learning win32 thesedays and playing with PostMessage function.
tricky thing i found was when posting WM_TIMER message into window message queue, window didn't receive any message. if only receive when i set lparam to 0, otherwise not working at all the code here. and also i tested with sendmessage which is totally fine either ways.
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg)
{
case WM_CREATE:
{
//PostMessage(hWnd, WM_TIMER, 0, 0); // receive msg
PostMessage(hWnd, WM_TIMER, 0, 1); // not receiving
}
return 0;
case WM_TIMER:
{
switch (wparam)
{
case 0:
{
HDC dc = GetDC(hWnd);
Ellipse(dc, 70, 70, 120, 120);
ReleaseDC(hWnd, dc);
}
break;
}
return 0;
}
}
return DefWindowProc(hWnd, msg, wparam, lparam);
}
would be amazing if somebody explain why this is happening. just hope i am missing some basic concept of windows processing system.