Sign in to follow this  
Followers 0
ANtiPriuSS

Need a bit of help with WinActivate

3 posts in this topic

#1 ·  Posted

Hello,

 

Im trying to build a small program to swap windows using an ini file and the win activate command but cant figure out how to format it correctly.

the windows that I want to swap will always be named blah. a varriable that Id just like to be able to control by an ini unless there is a better way.

Thanks in advanced!

 

#include <GUIConstants.au3>
$i = 0
$Name1 = IniRead ("settings.ini", "Input Section", "Name1", "")
$Name2 = IniRead ("settings.ini", "Input Section", "Name2", "")
$Name3 = IniRead ("settings.ini", "Input Section", "Name3", "")




$MainGUI = GUICreate("swap", 202, 200, -1, -1)
GUICtrlCreateLabel ( $Name1, 8, 8 )


$Start = GUICtrlCreateButton("Start", 72, 167, 57, 25, 0)


GUISetState(@SW_SHOW)





While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Start
            Do
               WinActivate(blah.$Name1[, ""])
               Sleep(120000)
               WinActivate(blah.$Name2[, ""])
               Sleep(120000)
               WinActivate(blah.$Name3[, ""])
               Sleep(120000)
            Until $i = 1
    EndSwitch
WEnd

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

Maybe this?

WinActivate("blah." & $Name1)

 

Share this post


Link to post
Share on other sites

#3 ·  Posted

Thank 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