Reputation: 127
There is something curious going on on my Windows machine. I have an application that calls MessageBoxA(...)
auto errorCode = MessageBoxA(NULL, "Somtext", "Sometitle", MB_YESNO | MB_TASKMODAL | MB_SETFOREGROUND | MB_DEFBUTTON1);
The problem is that the message box is never shown. The call to MessageBoxA(...) returns immediately and errorCode
tells me that the default button was pressed. So far so strange. In addition to that here is what I also found out.
I'm running Windows 7 embedded. Is there someone out there which has an idea what's going on here?
Upvotes: 1
Views: 827
Reputation: 127
The problem are those two registry keys:
HKLM\System\CurrentControlSet\Control\Error Message Instrument\EnableDefaultReply
and
HKLM\System\CurrentControlSet\Control\Error Message Instrument\EnableLogging
0 = Do not log message boxes that have been handled by Dialog box filter (Application Log)
1 = Log message boxes that have been handled by Dialog box filter (Application Log)
A discussion about this can be found here
Thank you Hans Passant
Upvotes: 2