Hi,
I'm trying to understand this code. This is the message loop in WinMain, it keeps asking for messages.
.WHILE TRUE
invoke GetMessage, ADDR msg,0,0,0
.BREAK .IF (!eax) ; break if no message
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
.ENDW
I have a few questions:
1. Is GetMessage an API call? Is there one big global message queue, managed by Windows, where all messages are stored, with the handles of the windows they are sent to? Or many message queues, one for every application?
2. Why does it "break if no message" (eax == 0)? If there is no message waiting the window is supposed to just stay there, not close!
3. What does TranslateMessage do?
4. What does DispatchMessage do?
I'm trying to understand this code. This is the message loop in WinMain, it keeps asking for messages.
.WHILE TRUE
invoke GetMessage, ADDR msg,0,0,0
.BREAK .IF (!eax) ; break if no message
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
.ENDW
I have a few questions:
1. Is GetMessage an API call? Is there one big global message queue, managed by Windows, where all messages are stored, with the handles of the windows they are sent to? Or many message queues, one for every application?
2. Why does it "break if no message" (eax == 0)? If there is no message waiting the window is supposed to just stay there, not close!
3. What does TranslateMessage do?
4. What does DispatchMessage do?