vaya Posted March 8, 2011 Share 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 Link to comment Share on other sites More sharing options...
Xandy Posted March 8, 2011 Share 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); lordofthestrings 1 Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
martin Posted March 8, 2011 Share 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. Link to comment Share on other sites More sharing options...
vaya Posted March 9, 2011 Author Share Posted March 9, 2011 Oh !! many thanks .. great help .. Link to comment Share on other sites More sharing options...
vaya Posted March 9, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 9, 2011 Moderators Share 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. Link to comment Share on other sites More sharing options...
lordofthestrings Posted October 24, 2013 Share 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now