If an application passes an invalid window handle to the MessageBox API, and the lower 16 bits of that handle are NULL, Windows ...

If an application passes an invalid window handle to the MessageBox API, and the lower 16 bits of that handle are NULL, Windows 9x treats it as the desktop (because window handles are only 16 bit on Windows 9x). On Windows XP, since the full 32 bits are used, the call to MessageBox would fail. This compatibility fix intercepts the MessageBox API and determines if the window handle that was passed is a valid handle. If it is not valid, it is set to NULL.