NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: mcamember on January 04, 2008, 05:31:55 PM

Title: Dialog box always on top
Post by: mcamember on January 04, 2008, 05:31:55 PM
Hi,

I have a main window created with

CreateWindowEx / dwStyle = WS_OVERLAPPEDWINDOW +WS_SYSMENU +WS_CAPTION +WS_TABSTOP +WS_VISIBLE +WS_VSCROLL

A menu selection invokes
        CreateDialogIndirectParam using DLGTEMPLATE / style =WS_CAPTION +WS_VISIBLE +WS_SYSMENU

I'm able to shift focus between the windows o.k. but the dialog box seems always to be on top.

The dialog box is positioned next to the main window but there are times when I want the user to be able to stretch the main window to read an extra long line of data. But this is possible only if the dialog is grabbed and moved out of the way even though focus *seems* to have moved to main ( the user can scroll main up and down and its menu becomes active again.)

As you can see from above, I'm using DLGTEMPLATE and DLGITEMTEMPLATE strucs declared within the application's data section.

Thanks in advance.
afk
Title: Re: Dialog box always on top
Post by: mcamember on January 05, 2008, 09:28:13 PM
I found it. Windows sets the z-order of the dialog box so that it is always higher than the parent.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/dialogboxprogrammingconsiderations.asp#keyboard_iface (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/dialogboxprogrammingconsiderations.asp#keyboard_iface)
afk