Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29487 Discussions

Dialogues defiantly stay on top - How do I control them?

acar
Beginner
1,405 Views
Hello, I'm writing an application in IVF using dialogs. Whilst I have tried changing various possible settings for the dialogs I have failed to stop them remaining visible and on-top when my application is minimised. I wonder if anyone can show me how to make them behave appropriately?
Thanks,
ACAR.
0 Kudos
1 Solution
Jugoslav_Dujic
Valued Contributor II
1,405 Views
You can use SetParent() API, but
1) You have to find the dialog handle first (I hope that your third-party GUI builder supports that)
2) APIs such as SetParent(), SetStyle() do not always work the same way as when the parent/style is assigned during window creation (i.e. you cannot really change the property even though the function reports success). The behavior description is scattered accross the documentation though. I am not sure if SetParent works that way too, but you can try.

Spy++ (VS Tools/Spy++) is your friend for examining properties of "live" windows. Take a look at WS_EX_TOPMOST bit under the dialog's "extended styles"; you might want to remove that, too (SetWindowPos if I recall correctly, my Win32 is a bit rusty now).

View solution in original post

0 Kudos
5 Replies
Paul_Curtis
Valued Contributor I
1,405 Views
Dialogs which are children of your app's parent window and modeless, will be minimized along with the parent.
0 Kudos
acar
Beginner
1,405 Views
One would have thought so but they are stubborn children! One point is that I'm using a third-party GUI builder whilst I'm building the dialogs in IVF. So, perhaps, they have no idea of who their parent is. Do you know how I might introduce them?
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,406 Views
You can use SetParent() API, but
1) You have to find the dialog handle first (I hope that your third-party GUI builder supports that)
2) APIs such as SetParent(), SetStyle() do not always work the same way as when the parent/style is assigned during window creation (i.e. you cannot really change the property even though the function reports success). The behavior description is scattered accross the documentation though. I am not sure if SetParent works that way too, but you can try.

Spy++ (VS Tools/Spy++) is your friend for examining properties of "live" windows. Take a look at WS_EX_TOPMOST bit under the dialog's "extended styles"; you might want to remove that, too (SetWindowPos if I recall correctly, my Win32 is a bit rusty now).
0 Kudos
acar
Beginner
1,405 Views
Thanks for the response Jugoslav. I'll have a go and report progress.
0 Kudos
acar
Beginner
1,405 Views
I've solved this problem in the following manner:
1) using a function provided by my gui builder of the main application window handle and,
2) passing this handle as an optional argument in the function dlgmodeless.
The dialogs now minimise with the main application window.
Thanks for your help.
ACAR.
0 Kudos
Reply