Jump to content

GUI on Top


vaya
 Share

Recommended Posts

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

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);

Link to comment
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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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

  • 2 years later...

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...