LRESULT DialogBoxParam(HINSTANCE HandleInstance, LPCSTR NomModele, HWND HandleFenetre, DLGPROC TraiterMessages, LPARAM lParam);
La boîte de dialogie a sa propre boucle de messages, ce qui la rend modale.
#include <windows.h>
#include <winbase.h>
HINSTANCE HandleInstance;
HWND HandleFenetre;
HWND HandleBoiteDeDialogue;
static LRESULT CALLBACK TraiterMessages(HWND HandleBoiteDeDialogue, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch (Msg)
{
...
}
return(0);
}
if (!DialogBoxParam(HandleInstance, "MaDialogue", HandleFenetre, (DLGPROC)TraiterMessages, 0L))
{
...
}
...
EndDialog(HandleBoiteDeDialogue, 0);
...