Tu devrais te faire tes propres MessageBox, mais avec des CreateWindow (au lieu de boites de dialogues). Comme ca ce n'est plus bloquant.
L'autre solution est de garder MessageBox, et de l'affichier dans un thread:
DWORD WINAPI ThreadProc(LPVOID lpParameter)
{
LPMBSTRUCT lpmbs = (LPMBSTRUCT)lpParameter;
MessageBox(lpmbs->hWnd, lpmbs->lpText, lpmbs->lpCaption, lpmbs->uType);
return 1;
}
typedef struct tagMBSTRUCT
{
HWND hWnd;
LPCTSTR lpText;
LPCTSTR lpCaption;
UINT uType;
} MBSTRUCT, *LPMBSTRUCT;
Et pour créer la MessageBox:
MBSTRUCT mbs;
// remplir la structure
CreateThread(0, 0, MsgBoxThread, &mbs, 0, 0);
|