PRB: DialogBox() Call w/ Desktop Window Handle Disables Mouse

ID: Q129597


The information in this article applies to:
  • Microsoft Win32s version 1.2


SYMPTOMS

Under Windows NT and Windows 95, you can call DialogBox() using the return from GetDesktopWindow() as the parent window handle. However, doing the same thing under Win32s will disable the mouse. Clicking any mouse button results in a beep, and you must reboot the computer to enable the mouse again.


CAUSE

This is a bug in Windows, not Win32s. The same thing occurs from a 16-bit Windows-based application. Internally, Windows disables the parent window by calling EnableWindow(hwndParent, FALSE). If the handle is the desktop window handle, the desktop window is disabled. This disables the mouse as well, due to the bug in the Windows code.


RESOLUTION

Do not call DialogBox() with the desktop window handle as the parent window handle.

Additional query words: 1.20 HWND_DESKTOP

Keywords :
Version : WINDOWS:1.2
Platform : WINDOWS
Issue type :


Last Reviewed: January 10, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.