Jump to content

Recommended Posts

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

  On 5/18/2010 at 7:21 PM, 'zorphnog said:

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
Posted

  On 5/18/2010 at 7:45 PM, 'Craberos said:

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
Posted

  On 5/18/2010 at 7:54 PM, 'simon387 said:

#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

  Quote

i copied your code and tried it is not working

Posted (edited)

  On 5/18/2010 at 8:35 PM, 'somdcomputerguy said:

Use the extended style $WS_EX_TOPMOST in GUICreate.

  Quote

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
Posted

  On 5/19/2010 at 1:13 AM, 'somdcomputerguy said:

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

  Quote

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

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
  • Recently Browsing   0 members

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