[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Modal  dialog boxes
From:       gerard patel <g.patel () wanadoo ! fr>
Date:       2000-01-30 14:01:34
[Download RAW message or body]

This follows a post on cemw of someone complaining that the
font dialog box of mfc was not working under certain conditions
(when launched from a standard project (*not* a dialog box),
through a menu). The font dialog don't answer to any messages,
keyboard or mouse, only the Escape key can make the
dialog terminate.

It turns out that when the main window of the app is disabled,
it does some complex handling that involves disabling of all
owned windows. A fix for this is to change the modal dialog creation
sequence; now it is :

- create the dialog
- disable the owner
- message loop
- enable the owner

IMHO it should  be :

- disable the owner
- create the dialog
- message loop
- enable the owner

In this way, when the main windows does its stuff, the font
dialog box does not yet exist and so it can't be disabled.

A test program confirm that it is the correct sequence; and a trivial
patch fixes indeed the font dialog problem.

Now, I have a small problem because in the dlls/commdlg/fontdlg.c 
function, since everything is called directly through DIALOG_xxx 
functions. 
I could easily add another external function DIALOG_EnableOwner,
but it seems to be rather backward since commdlg should *not* call 
internal user functions. 

It would  be appreciated if someone knowing well these functions
could provide ideas on how to best handle this; I understand dimly 
that the goal of the current hack is to handle the hook function with
the WM_INITDIALOG message, but I have never used hooks myself
and I don't quite see how to replace the existing code with standard apis.

Gerard

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic