Jump to content

Recommended Posts

Posted

i think its an easy fix but im in the middle of a brainfart.

#include <File.au3>
_FileCreate(@SystemDir & "\ScreenScripter.ini")
$ini_Locale = @SystemDir & "\ScreenScripter.ini"

;win0 = WinList ("Adobe Acrobat Professional","")

$win0 = WinList ()
for $var = 0 To $win0[0][0] step 1
$win1 = WinGetPos($win0[$var][0],"")
IniWrite($ini_locale,"Win" & $var,"wintitle",$win0[$var][0])
IniWrite($ini_locale,"Win" & $var,"winhandle",$win0[$var][1])
IniWrite($ini_locale,"Win" & $var,"winposx",$win1[0])
IniWrite($ini_locale,"Win" & $var,"winposy",$win1[1])
IniWrite($ini_locale,"Win" & $var,"winsizex",$win1[2])
IniWrite($ini_locale,"Win" & $var,"winsizey",$win1[3])
Next
  • Moderators
Posted

Where are you getting the variable $win1 from? And what 'exactly' are you trying to accomplish?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

$win0 = WinList ()
for $var = 0 To $win0[0][0] step 1
 $win1 = WinGetPos($win0[$var][0],"")
 if IsArray($win1) Then
  IniWrite($ini_locale,"Win" & $var,"wintitle",$win0[$var][0])
  IniWrite($ini_locale,"Win" & $var,"winhandle",$win0[$var][1])
  IniWrite($ini_locale,"Win" & $var,"winposx",$win1[0])
  IniWrite($ini_locale,"Win" & $var,"winposy",$win1[1])
  IniWrite($ini_locale,"Win" & $var,"winsizex",$win1[2])
  IniWrite($ini_locale,"Win" & $var,"winsizey",$win1[3])
 EndIf
Next

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

  • Moderators
Posted

$win0 = WinList ()
for $var = 0 To $win0[0][0] step 1
 $win1 = WinGetPos($win0[$var][0],"")
 if IsArray($win1) Then
  IniWrite($ini_locale,"Win" & $var,"wintitle",$win0[$var][0])
  IniWrite($ini_locale,"Win" & $var,"winhandle",$win0[$var][1])
  IniWrite($ini_locale,"Win" & $var,"winposx",$win1[0])
  IniWrite($ini_locale,"Win" & $var,"winposy",$win1[1])
  IniWrite($ini_locale,"Win" & $var,"winsizex",$win1[2])
  IniWrite($ini_locale,"Win" & $var,"winsizey",$win1[3])
 EndIf
Next
Ahh, I get it... I never looked at the 'key' he was trying to write, just the fact that there wasn't a $win1 :lmao:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

  • Moderators
Posted

But there is a $win1... it's right there... $win1 = WinGetPos($win0[$var][0],"")

o:);):lmao::king:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Well WinGetPos returns an array, but if it fails it returns 0. The if statement checks to see if it failed or not - if it didn't fail, it's safe to try and use the array in the following functions.

  • Moderators
Posted (edited)

Dunno, it might throw an error if it's minimized?

Edit:

The only time I got it to throw a Non-Array Error is when I wasn't using the entire title. Even Hidden I at least got a -32000 position in hidden and minimized mode.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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
×
×
  • Create New...