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

Last reviewed: May 1, 1995
Article 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 reference words: 1.20 HWND_DESKTOP
KBCategory: kprg kbprb
KBSubcategory: W32s


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 1, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.