how can I let a dialog always stay on the top?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
caomeisanhao
Junior Coder
Posts: 28
Joined: Wed Jun 08, 2005 2:48 pm

how can I let a dialog always stay on the top?

Post by caomeisanhao » Tue Jul 12, 2005 3:24 pm

Hi,guys
how can I let a dialog always stay on the top?
just like variable MSG_STAYONTOP,but for Dialog

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Jul 12, 2005 3:45 pm

Like this:

Dialog>Dialog1
Caption=Dialog1
Top=112
Width=226
Left=16
Height=103
Button=msButton1,32,32,75,25,0
EndDialog>Dialog1

Let>HWND_TOPMOST=-1
Let>SWP_NOSIZE=1
Let>SWP_NOMOVE=2
Let>Flags={%SWP_NOSIZE% OR %SWP_NOMOVE%}
Show>Dialog1
LibFunc>user32,FindWindowA,hwnd,TForm,Dialog1
LibFunc>user32,SetWindowPos,r,hwnd,HWND_TOPMOST,0,0,0,0,Flags
CloseWindow>Dialog1
Show>Dialog1,r
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts