Jump to content

What is wrong?


Andre
 Share

Recommended Posts

Hi,

I'm having trouble with :

;----
; Variables Declaration
;----
 
Dim $MaxWindows = 15
Dim $Arr[($MaxWindows +1) * 2]
Dim $Counter = 1
Dim $NameOfWindow = "Rekenma"; Change into "Calculator" for English OS
;Dim $NameOfWindow = "classname=SciCalc"
Dim $I

; ----------------------------------------------------------------------------
; Set up our defaults
; ----------------------------------------------------------------------------
AutoItSetOption("WinTitleMatchMode", 4)
AutoItSetOption("MustDeclareVars",1) 
; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------
Run("calc.exe")
Run("calc.exe")
Run("calc.exe")
 
Sleep(1250)

For $I = 1 To $MaxWindows
If WinExists($NameOfWindow,"") Then
      $Arr[$Counter] = WinGetTitle($NameOfWindow,"")
      $Counter = $Counter + 1
      WinSetTitle($NameOfWindow,"", $Counter & "My New Window")
      $Arr[$Counter] = WinGetTitle($Counter & "My New Window","")
      $Counter = $Counter + 1
      Sleep(500)
   EndIf
Next
 
Sleep(3000) 

If WinExists($NameOfWindow,"") Then
      WinSetState($NameOfWindow,"",@SW_SHOW)
EndIf
 
For $I = $Counter  To 1 Step -2
  If $I = 1 Then ExitLoop
  
  WinSetTitle($Arr[$I -1] ,"", $Arr[$I-2])
   Sleep(125)
Next

When i change

Dim $NameOfWindow = "Rekenma" ; Change into "Calculator" for English OS

to

Dim $NameOfWindow = "classname=SciCalc"

It Only works for one window, change it back and it works for all the windows.

Regards,

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

  • Developers

Andre,

With the senario where you use the WindowTitle it works like this:

- find the first window startin with "Rekenmachine"

- Change the title to something else...

- next loop

So the next time you search for title "Rekenmachine" it will find the next window since the first one is changed.

With the Find Classname senario you find everytime the same window since the classname doesn't change.. only itswindow title....

:ph34r:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

JdeB,

Of cource, a thinking faillure :(

I'm fooling around to make an MSN Messenger Boss Tool :ph34r:

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
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
 Share

  • Recently Browsing   0 members

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