Craberos Posted May 18, 2010 Share Posted May 18, 2010 (edited) hello all thanks for all the help provided can anyone tell me the code to 1. make a GUI always on top thanks craberos Edited May 18, 2010 by Craberos Link to comment Share on other sites More sharing options...
zorphnog Posted May 18, 2010 Share Posted May 18, 2010 WinSetOnTop. Look at the help file, it's there for a reason. Link to comment Share on other sites More sharing options...
Craberos Posted May 18, 2010 Author Share Posted May 18, 2010 (edited) WinSetOnTop. Look at the help file, it's there for a reason. that did not work i need to make the gui created by autoit to be always on topexpandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $button_1,$button_2, $button_3, $button_4 Local $Halt, $msg Opt("GUICoordMode", 1) GUICreate("T", 140, 260) $button_1 = GUICtrlCreateButton("Earth", 20, 20, 100, 40) $button_2 = GUICtrlCreateButton("Water", 20, 80, 100, 40) $button_3 = GUICtrlCreateButton("Fire", 20, 140, 100, 40) $button_4 = GUICtrlCreateButton("Air", 20, 200, 100, 40) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $button_1 WinActivate ("Earth") Case $msg = $button_2 WinActivate ("Water") Case $msg = $button_3 WinActivate ("Fire") Case $msg = $button_4 WinActivate ("Air") Case $Halt = $msg EndSelect WEnd EndFunc Edited May 18, 2010 by Craberos Link to comment Share on other sites More sharing options...
simon387 Posted May 18, 2010 Share Posted May 18, 2010 that did not work i need to make the gui created by autoit to be always on topexpandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $button_1,$button_2, $button_3, $button_4 Local $Halt, $msg Opt("GUICoordMode", 1) GUICreate("T", 140, 260) $button_1 = GUICtrlCreateButton("Earth", 20, 20, 100, 40) $button_2 = GUICtrlCreateButton("Water", 20, 80, 100, 40) $button_3 = GUICtrlCreateButton("Fire", 20, 140, 100, 40) $button_4 = GUICtrlCreateButton("Air", 20, 200, 100, 40) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $button_1 WinActivate ("Earth") Case $msg = $button_2 WinActivate ("Water") Case $msg = $button_3 WinActivate ("Fire") Case $msg = $button_4 WinActivate ("Air") Case $Halt = $msg EndSelect WEnd EndFunc expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $button_1,$button_2, $button_3, $button_4 Local $Halt, $msg Opt("GUICoordMode", 1) GUICreate("T", 140, 260) $button_1 = GUICtrlCreateButton("Earth", 20, 20, 100, 40) $button_2 = GUICtrlCreateButton("Water", 20, 80, 100, 40) $button_3 = GUICtrlCreateButton("Fire", 20, 140, 100, 40) $button_4 = GUICtrlCreateButton("Air", 20, 200, 100, 40) WinSetOnTop("T", "", 1) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $button_1 WinActivate ("Earth") Case $msg = $button_2 WinActivate ("Water") Case $msg = $button_3 WinActivate ("Fire") Case $msg = $button_4 WinActivate ("Air") Case $Halt = $msg EndSelect WEnd EndFunc Link to comment Share on other sites More sharing options...
Craberos Posted May 18, 2010 Author Share Posted May 18, 2010 expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $button_1,$button_2, $button_3, $button_4 Local $Halt, $msg Opt("GUICoordMode", 1) GUICreate("T", 140, 260) $button_1 = GUICtrlCreateButton("Earth", 20, 20, 100, 40) $button_2 = GUICtrlCreateButton("Water", 20, 80, 100, 40) $button_3 = GUICtrlCreateButton("Fire", 20, 140, 100, 40) $button_4 = GUICtrlCreateButton("Air", 20, 200, 100, 40) WinSetOnTop("T", "", 1) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $button_1 WinActivate ("Earth") Case $msg = $button_2 WinActivate ("Water") Case $msg = $button_3 WinActivate ("Fire") Case $msg = $button_4 WinActivate ("Air") Case $Halt = $msg EndSelect WEnd EndFunc i copied your code and tried it is not working Link to comment Share on other sites More sharing options...
somdcomputerguy Posted May 18, 2010 Share Posted May 18, 2010 (edited) Use the extended style $WS_EX_TOPMOST in GUICreate. Edited May 18, 2010 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Craberos Posted May 18, 2010 Author Share Posted May 18, 2010 (edited) Use the extended style $WS_EX_TOPMOST in GUICreate. i had to include "#include <WindowsConstants.au3>" and it worked but previously it was centered now it is on the left corner of the desktop any solutions expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $button_1,$button_2, $button_3, $button_4 Local $Halt, $msg Opt("GUICoordMode", 1) GUICreate("T", 140, 260,$WS_EX_TOPMOST) $button_1 = GUICtrlCreateButton("Earth", 20, 20, 100, 40) $button_2 = GUICtrlCreateButton("Water", 20, 80, 100, 40) $button_3 = GUICtrlCreateButton("Fire", 20, 140, 100, 40) $button_4 = GUICtrlCreateButton("Air", 20, 200, 100, 40) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $button_1 WinActivate ("Earth") Case $msg = $button_2 WinActivate ("Water") Case $msg = $button_3 WinActivate ("Fire") Case $msg = $button_4 WinActivate ("Air") Case $Halt = $msg EndSelect WEnd EndFunc Edited May 18, 2010 by Craberos Link to comment Share on other sites More sharing options...
somdcomputerguy Posted May 19, 2010 Share Posted May 19, 2010 (edited) Use GUICreate("T", 140, 260, -1, -1, Default, $WS_EX_TOPMOST). Edited May 19, 2010 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Craberos Posted May 19, 2010 Author Share Posted May 19, 2010 Use GUICreate("T", 140, 260, -1, -1, Default, $WS_EX_TOPMOST).thanks a ton somdcomputerguy it worked like a charm thanks you 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