On 23 February 2008 21:51, Dave Korn wrote: > Yes, I see, the dialog isn't modal and so it allows the 'X' which is > effectively the same as cancelling. The solution has two parts then: 1) > make the pop-up modal so the user can't mess with the app's main window > while answering the question, and 2) make sure clicking 'cancel' or 'X' > while in the middle of installing anyway close down gracefully. Part 1 > I've already figured out.
And here is part 1. The problem is that calling MessageBox (NULL, ...) to modally block the main dialog window can only work when you're running from that window's main message thread; otherwise windoze has no idea which window you might be referring to. The install code runs in a separate thread, so the trivial solution is to pass in the HWND for the main dialog (which it has available from the thread startup context arguments) and specify it explicitly as the owner in MessageBox calls, and that's what this patch does. 2008-02-24 Dave Korn <[EMAIL PROTECTED]> * install.cc (Installer::installOne): Accept new HWND argument from caller and pass it to MessageBox calls so that MB_TASKMODAL can work. (check_for_old_cygwin): Likewise. (do_install_thread): Pass owner's HWND (from thread context) when calling them. cheers, DaveK -- Can't think of a witty .sigline today....
setup-modal-dialogs-patch.diff
Description: Binary data