Jump to content
Sign in to follow this  
clearguy

How to set Focus of a GUIWindow?

Recommended Posts

Please tell me how to set he focus of an GUIwindow.

I explain: I want that this window is always in the foreground:

#include <GUIConstants.au3>
$i = 0
$Counting = 0
$Form1 = GUICreate("SUPER FREAKING AWSOME COUNTER OF GOD", 479, 180, 192, 125)
$input = GUICtrlCreateInput("", 112, 136, 233, 21, -1, $WS_EX_CLIENTEDGE)
$count = GUICtrlCreateButton("Start Count", 144, 32, 161, 65)
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    If $msg = $count Then
        $Counting = 1
        GUICtrlSetData($count,"Stop Count")
        While $Counting = 1
            $msg = GUIGetMsg()
            $i += 1; $i = $i + 1
            GUICtrlSetData($input,$i)
            If $msg = $GUI_EVENT_CLOSE Then Exit
            If $msg = $count and $counting = 1 Then
                ExitLoop
            EndIf
        WEnd
        $Counting = 0
        GUICtrlSetData($count,"Start Count")
    EndIf
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd

Share this post


Link to post
Share on other sites

WinSetOnTop("SUPER FREAKING AWSOME COUNTER OF GOD")

Was that syntax right?

Close, just forgot a little bit.

WinSetOnTop ( "SUPER FREAKING AWSOME COUNTER OF GOD", "", 1 )

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  

×
×
  • Create New...