Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Modality issues with WS_EX_APPWINDOW

269 views
Skip to first unread message

Jon-Patrick Collins

unread,
Oct 25, 2000, 8:34:13 PM10/25/00
to
In our multiple-document (not MDI) application we enforce a Windows
taskbar button to appear for EACH document window by adding
WS_EX_APPWINDOW to the document window style using SetWindowLong().

In principle, this works very well, and gives a Word 2000-like effect,
whereby it becomes very easy to swap between maximised document
windows using the Windows taskbar.

However, modal forms and modal dialogs are a nuisance. The Windows
taskbar doesn't obey the modality requirement, allowing a window other
than the modal window to receive the input focus. If this window
entirely obscures the modal window, the only way to re-focus the modal
window is to use the taskbar button. The killer is that I am not able
to force dialog boxes (such as the Open file dialog) to appear on the
taskbar using WE_EX_APPWINDOW. This means we are jammed, and have to
shut down the application.

It seems there are two ways out of this impasse:

(1) Find a way of adding modal dialogs to the Windows taskbar. This is
NOT the preferred solution (this isn't what Word 2000 does). This
would still allow non-modal windows to appear on top of modal windows,
which is still confusing, but the taskbar buttons would still offer a
way out.

(2) Prevent the taskbar button event from activating a window in the
application if the application is displaying a modal window. This is
what Word 2000 does, and would be preferred. Any attempt to de-focus a
modal window or dialog is rejected. (The taskbar button of the new
window DOES depress, but immediately after focusing this new window,
the modal window re-focuses).

Thanks for any help you can offer,
JP Collins

Development environment:
TooL: Delphi 4.0
OS: Windows NT/98/95/2000

Jackson Yee

unread,
Oct 26, 2000, 4:53:02 PM10/26/00
to
JP, Windows usually makes a modal dialog active when its application's
taskbar button is clicked upon, since modal dialogs disable their parent
window. Are you sure that you're passing in your main window as the parent
of the dialog when you create it?

--
Regards,
Jackson Yee
http://jacksonyee.welcome.to/

"Jon-Patrick Collins" <str...@gd.com.au> wrote in message
news:39f77771....@news.flow.com.au...

0 new messages