Monday, January 15, 2018

SetErrorMode windows api

Here's how I understand the SetErrorMode windows api. It takes one parameter, the mode which is a bunch of bitwise flags that can be set toggling certain error features on and off.


In this case 8001 was passed as the flags.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms680621(v=vs.85).aspx

MSDN says that
0x8000 is "SEM_NOOPENFILEERRORBOX"
0x0001 is "SEM_FAILCRITICALERRORS"

which per the documentation appear to indicate that "OpenFile" will NOT generate an error message box if it fails to find the file it opened but instead just bubble the error up to the caller.  Also it indicates that the system will not display critical error handler messages (this appears to be a best practice, so normal).


No comments:

Post a Comment