Sign in to follow this  
Followers 0
vaya

GUI on Top

7 posts in this topic

Hello Experts,

I ve created autoit GUI script which works fine , this script reactes also with a windows GUI program . Every thing works fine , but when I start my Autoit gui script , it is behind another windows form(gui) . I would like that my autoit should be on top when it starts . does anyone have an idea how I can fix this?

Many thanks in advance

Share this post


Link to post
Share on other sites



this works for me:

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
$hgui= 0

$hgui = guicreate("dialog window appears as top window when I run script", 600, 300);
GUISetState(@sw_show)

$done= 0
while $done== 0
    $msg= GUIGetMsg()
    
    if $msg== $GUI_EVENT_CLOSE then $done= 1
WEnd

did you want the window to remain as top window?

$hgui = guicreate("dialog window always on top", 600, 300, 0, 0, -1, $WS_EX_TOPMOST);

just swap

$hgui = guicreate("dialog window appears as top window when I run script", 600, 300)

with

$hgui = guicreate("dialog window always on top", 600, 300, 0, 0, -1, $WS_EX_TOPMOST);

1 person likes this

I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

... or to bring it to the top when you want to

WinSetOnTop($hGui,"",1)


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Oh !! many thanks .. great help ..

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

thanks songersoft & Martin,

it works fine , but I still have one question . is there a way to force my GUI to be in front of an open windows , not behind ...). I start my autoit Gui, this gui is behind another windows form. I want to force it to be in front....

I hope I can get an advise ...

Thanks in advance

Edited by vaya

Share this post


Link to post
Share on other sites

In the style section, try $DS_SETFOREGROUND


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

this works for me:

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
$hgui= 0

$hgui = guicreate("dialog window appears as top window when I run script", 600, 300);
GUISetState(@sw_show)

$done= 0
while $done== 0
    $msg= GUIGetMsg()
    
    if $msg== $GUI_EVENT_CLOSE then $done= 1
WEnd
did you want the window to remain as top window?

$hgui = guicreate("dialog window always on top", 600, 300, 0, 0, -1, $WS_EX_TOPMOST);
just swap

$hgui = guicreate("dialog window appears as top window when I run script", 600, 300)

with

$hgui = guicreate("dialog window always on top", 600, 300, 0, 0, -1, $WS_EX_TOPMOST);

 

Xandy you solved one of my final problems in my latest script :-) great thanks!


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0