From: Ken Snyder on
hi,

i do have a application that mainly exists of a WinMain() that creates a
DialogBox() and has a big DialogProc() that handles all controls and
commands. one of the commands invokes a second DialogBox() with its own
DialogProc() but the second dialog is not modal to the main dialog, that
is, it will be overlapped by the main dialog when i click on the main
dialog and whenever i click on the button that creates the second dialog
i get more and more dialogs but none of them is modal to the main
dialog. What am i doing wrong here? is maybe the dialog box template
missing something or has the main dialog something wrong on its
template? What is my fault here? Anyone can give me some guidance? This
is not a MFC application btw, its plain C.

cheers

ken
From: David Lowndes on
>i do have a application that mainly exists of a WinMain() that creates a
>DialogBox() and has a big DialogProc() that handles all controls and
>commands. one of the commands invokes a second DialogBox() with its own
>DialogProc() but the second dialog is not modal to the main dialog, that
>is, it will be overlapped by the main dialog when i click on the main
>dialog and whenever i click on the button that creates the second dialog
>i get more and more dialogs but none of them is modal to the main
>dialog. What am i doing wrong here?

What window handle are you passing as the parent window handle for
your nested dialog?

Dave
From: Ken Snyder on
On 17.02.2010 13:34, David Lowndes wrote:
>> i do have a application that mainly exists of a WinMain() that creates a
>> DialogBox() and has a big DialogProc() that handles all controls and
>> commands. one of the commands invokes a second DialogBox() with its own
>> DialogProc() but the second dialog is not modal to the main dialog, that
>> is, it will be overlapped by the main dialog when i click on the main
>> dialog and whenever i click on the button that creates the second dialog
>> i get more and more dialogs but none of them is modal to the main
>> dialog. What am i doing wrong here?
>
> What window handle are you passing as the parent window handle for
> your nested dialog?
>
> Dave

hi david,

yes, i was passing the wrong handle, thank you. I get the handles for
the windows from within a array of handles and it was simply a wrong
offset i used. this made me fix that.


cheers ken
From: Joseph M. Newcomer on
On Wed, 17 Feb 2010 09:45:51 +0100, Ken Snyder <mp5fmj(a)hotmail.com> wrote:

>hi,
>
>i do have a application that mainly exists of a WinMain() that creates a
>DialogBox() and has a big DialogProc() that handles all controls and
>commands. one of the commands invokes a second DialogBox() with its own
>DialogProc() but the second dialog is not modal to the main dialog, that
>is, it will be overlapped by the main dialog when i click on the main
>dialog and whenever i click on the button that creates the second dialog
>i get more and more dialogs but none of them is modal to the main
>dialog. What am i doing wrong here? is maybe the dialog box template
>missing something or has the main dialog something wrong on its
>template? What is my fault here? Anyone can give me some guidance? This
>is not a MFC application btw, its plain C.
****
Show the code that creates the child dialog. I would guess that the parent window
parameter is NULL, which is the most common error we used to see in such applications.
joe
****
>
>cheers
>
>ken
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm