Modal and AOT exit dialog
Harold L Hunt II
huntharo@msu.edu
Sun Mar 28 19:27:00 GMT 2004
Takuma,
Takuma Murakami wrote:
> I have been considering to change the exit confirmation dialog
> to a modal and always-on-top one (shown by MessageBox()).
I know that a MessageBox won't work well because it interrupts our
message processing and blocks our main thread until the user clicks the
box. Think if they clicked it on accident then went to get coffe. They
would come back and XWin.exe would be terminated because its message
queue overflowed. Not good :)
> The benefits of this change are:
> - We can easily change the message at runtime. I want to print
> the number of connected clients each time it is shown.
This can easily be done in the curent dialog box. It is easy to set
text in a control on a dialog box. You would do it in
windialogs.c/winExitDlgProc/WM_INITDIALOG using the function
SetDlgItemInt() from the Win32 API. It is really easy.
> - We won't lose the dialog since it remains on the top.
This can be done already with the dialog too... we just have to change
the style of the window.
> - We can let Windows place it instead of winCenterDialog().
> The position will be intrinsically "correct" (winCenterDialog()
> gives different position in multi-monitor settings).
I think we can tweak winCenterDialog to make it show the same position
as MessageBox would put it in. Shouldn't be hard. In fact, it might be
really easy.
> I ask this because I don't know the reason why it was
> implemented as a separate non-modal window. I will start
> this change if there is no particular reason.
Well, it was originally done with a MessageBox (I don't know if I ever
released it that way) and the shortcomings became apparent quite
quickly. Please don't make this change, lets just modify the current
dialog box and other functions to achieve your goals.
Harold
More information about the Cygwin-xfree
mailing list