Is it possible to create application with main form and tool forms - all
"staying on top" in determined order?
Main form should be "topmost" above other applications, and tool forms
should be always above main form. I have to open tool forms by "Show"
(not "ShowModal").
I try for example:
SetWindowPos(Application.MainForm.Handle, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE);
SetWindowPos(Form1.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or
SWP_NOSIZE or SWP_NOACTIVATE);
SetWindowPos(Form2.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or
SWP_NOSIZE or SWP_NOACTIVATE);
All forms are staying on top but
Form1, Form2 are behind MainForm.
(Delphi7 Pro)
Thanks for any help
Roman
>
> Hello,
>
> Is it possible to create application with main form and tool forms -
> all "staying on top" in determined order? Main form should be
> "topmost" above other applications, and tool forms should be always
> above main form. I have to open tool forms by "Show" (not
> "ShowModal").
override the CreateParams method of the tool forms and there do
inherited;
Params.WndParent := Application.Mainform.Handle;
That will tie the tool windows to the main form in Z order. After you
have done that you have to avoid any changes to mainform properties
that would cause the forms window handle to be recreated. If you cannot
avoid that you have to override the main forms CreateWnd method and,
after having called the inherited method, notify all open tool windows
that they need to recreate their handles, too (RecreateWnd method).
--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
Thank you for your help,
Roman K.