Hi all, I would like to use MessageBox function to warn the operator in case of problems in the application with standard Windows interface. When I am calling the function the application is running a single thread. The function is called by the main panel, which is the only one active at the moment. I would like the message box to stay on top of the application like a MessagePopup but I don't succeed in stopping user interaction with the main panel.
I am using the function this way:
if (MessageBox ((HWND)GetCVIWindowHandle (), "Unable to start.", "Warning", MB_OK | MB_ICONSTOP | MB_APPLMODAL) == IDCANCEL)
return 0;
According to SDK socumentation "The user must respond to the message box before continuing work in the window identified by the hWnd parameter. However, the user can move to the windows of other threads and work in those windows. " Since I have only the main panel active, I don't understand why the user can click on the panel and operate on controls on it without being blocked in the message box: which other thread is active? Or the messagebox itself spawns its own thread? The behaviour is the same if I use MB_TASKMODAL, while it operates the way I want in case I use MB_SYSTEMMODAL, which should be used only in case of "serious, potentially damaging errors that require immediate attention", which I suppose is not my case,
This item can be confusing since the box is only put below the main panel but is not cancelled, so this window is always present even if it's not visible and the user doesn't knows how to "unblock" the machine.