Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>What do you mean when you say it "uses" Windows Messaging System? Are you consuming or sending Windows Messages?</p> <p>If you send a Windows message, you need ensure you are doing it correctly. I'd suggest writing a message loop to ensure your messages are being dispatched properly. I'd also suggest reading up on message loops and how they work.</p> <p><a href="http://www.winprog.org/tutorial/message_loop.html" rel="nofollow noreferrer"><strong>What is a Message Loop</strong></a> (click the title to be taken to the source of this info)</p> <pre><code>while(GetMessage(&amp;Msg, NULL, 0, 0) &gt; 0) { TranslateMessage(&amp;Msg); DispatchMessage(&amp;Msg); } </code></pre> <ol> <li>The message loop calls GetMessage(), which looks in your message queue. If the message queue is empty your program basically stops and waits for one (it Blocks).</li> <li>When an event occures causing a message to be added to the queue (for example the system registers a mouse click) GetMessages() returns a positive value indicating there is a message to be processed, and that it has filled in the members of the MSG structure we passed it. It returns 0 if it hits WM_QUIT, and a negative value if an error occured.</li> <li>We take the message (in the Msg variable) and pass it to TranslateMessage(), this does a bit of additional processing, translating virtual key messages into character messages. This step is actually optional, but certain things won't work if it's not there.</li> <li>Once that's done we pass the message to DispatchMessage(). What DispatchMessage() does is take the message, checks which window it is for and then looks up the Window Procedure for the window. It then calls that procedure, sending as parameters the handle of the window, the message, and wParam and lParam.</li> <li>In your window procedure you check the message and it's parameters, and do whatever you want with them! If you aren't handling the specific message, you almost always call DefWindowProc() which will perform the default actions for you (which often means it does nothing).</li> <li>Once you have finished processing the message, your windows procedure returns, DispatchMessage() returns, and we go back to the beginning of the loop.</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload