vaya 0 Posted March 8, 2011 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
Xandy 425 Posted March 8, 2011 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 lordofthestrings reacted to this Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Share this post Link to post Share on other sites
martin 85 Posted March 8, 2011 ... 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
vaya 0 Posted March 9, 2011 Oh !! many thanks .. great help .. Share this post Link to post Share on other sites
vaya 0 Posted March 9, 2011 (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 March 9, 2011 by vaya Share this post Link to post Share on other sites
SmOke_N 211 Posted March 9, 2011 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
lordofthestrings 3 Posted October 24, 2013 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