ghetek Posted January 16, 2006 Share Posted January 16, 2006 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 16, 2006 Moderators Share Posted January 16, 2006 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. Link to comment Share on other sites More sharing options...
GaryFrost Posted January 16, 2006 Share Posted January 16, 2006 $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. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 16, 2006 Moderators Share Posted January 16, 2006 $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 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. Link to comment Share on other sites More sharing options...
greenmachine Posted January 17, 2006 Share Posted January 17, 2006 But there is a $win1... it's right there... $win1 = WinGetPos($win0[$var][0],"") Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 17, 2006 Moderators Share Posted January 17, 2006 But there is a $win1... it's right there... $win1 = WinGetPos($win0[$var][0],"") 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. Link to comment Share on other sites More sharing options...
ghetek Posted January 17, 2006 Author Share Posted January 17, 2006 im not understanding why we need an if statement there. Link to comment Share on other sites More sharing options...
greenmachine Posted January 17, 2006 Share Posted January 17, 2006 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. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 17, 2006 Moderators Share Posted January 17, 2006 (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 January 17, 2006 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now