Knowledge Base

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

PSS ID Number: 129597

Article Last Modified on 1/12/2000


The information in this article applies to:


This article was previously published under Q129597

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: KB129597
Technology: kbWin32s120 kbWin32sSearch