Sign in to follow this  
Followers 0

GUI always on top

9 posts in this topic

Posted (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 by Craberos

Share this post


Link to post
Share on other sites



Posted

WinSetOnTop. Look at the help file, it's there for a reason.

Share this post


Link to post
Share on other sites

Posted (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 top

#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 by Craberos

Share this post


Link to post
Share on other sites

Posted

that did not work

i need to make the gui created by autoit to be always on top

#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

#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

Share this post


Link to post
Share on other sites

Posted

#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

Share this post


Link to post
Share on other sites

Posted (edited)

Use the extended style $WS_EX_TOPMOST in GUICreate.

Edited by somdcomputerguy

Share this post


Link to post
Share on other sites

Posted (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

#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 by Craberos

Share this post


Link to post
Share on other sites

Posted (edited)

Use GUICreate("T", 140, 260, -1, -1, Default, $WS_EX_TOPMOST).

Edited by somdcomputerguy

Share this post


Link to post
Share on other sites

Posted

Use GUICreate("T", 140, 260, -1, -1, Default, $WS_EX_TOPMOST).

thanks a ton somdcomputerguy it worked like a charm :idea: thanks you

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