Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can treat DialogBox as a complex comprised from several logical parts:</p> <ol> <li>Loading dialog definition resource;</li> <li>Creating the dialog window which is accomplished internally via several calls to CreateWindow: the first for the dialog itself and then for its controls found in the template;</li> <li>Blocking owner window to support "modality" and running a message pump: GetMessage -> IsDialogMessage or TranslateMessage+DispatchMessage.</li> </ol> <p>Speaking metaphorically this combination <em>is useful when the flow of your program must branch depending on user's decision, encapsulating that decision into the single call</em> to the DialogBox() function. This function really does a lot of work and eases the understanding of your program by hiding asynchronous nature of interaction with raw Win32 windows.</p> <p>However, this 'high-levelness', specifically the message loop contained within it, may actually raise the complexity of your program, if it already Win32 has message loop and the call to DialogBox is made as a response to a specific message. So in this case you have to take care about nested message loops, especially if you are custom message processing in your main message loop.</p> <p>In order to avoid such problems, CreateDialog function can be used which is also a complex but only of parts 1 and 2 - it doesn't start message loop. So, you have to provide your own message processing procedure. You should also take care about modality if it is required.</p> <p>In my practice I used DialogBox only several times for really small utility applications.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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