cueclub 0 Posted August 8, 2010 (edited) Here is my code Global $IniFile = @ScriptDir & "\settings.ini" Global $Brow1 = "MSN.com - Mozilla Firefox" global $wsize = iniread($inifile, "window", "size", "") WinWait($Brow1) if $wsize = "" then $size = WinGetPos($Brow1) IniWrite($IniFile, "Window", "pos", $size[0] & "," & $size[1]) iniwrite($inifile, "window", "size", $size[2] & "," & $size[3]) msgbox(0, "ESB 1.5", "Your window position has been saved", 20) endif $size1 = iniread($inifile, "window", "pos", "") $pos = stringsplit($size1, ",") $size2 = iniread($inifile, "window", "size", "") $size = stringsplit($size2, ",") sleep(5000) WinMove($Brow1, "", $pos[0], $pos[1], $size[1], $size[2]) The problem is.... the window is moved into a position, and I run the code. It either doesn't save it correctly, or it doesn't recall the cords correctly. as an example, the window would be in upper right corner, but will resize in the lower left corner. Anyone have any ideas? Thanks Cue edit:Marked as solved. Edited August 16, 2010 by cueclub Share this post Link to post Share on other sites
jaberwacky 327 Posted August 9, 2010 Is the .ini file large? If not, will you list the contents of the ini or at least the relevant sections? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Share this post Link to post Share on other sites
cueclub 0 Posted August 9, 2010 (edited) right now the only thing in the settings file are the window position and size. But here is what is written [Window] pos=644,154 size=726,587 So I know it is writing something. But the window ends up in a different position each time i try to do it. edit( added more info) Edited August 9, 2010 by cueclub Share this post Link to post Share on other sites
Realm 18 Posted August 9, 2010 I just tested it...and it works fine for me, unless I don't understand your problem correctely.....I tested with window maximized, it told me 'Your window position has been saved' so I minimized the window, ran again, and it maximized my window. Maybe I don't understand the problem? My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Share this post Link to post Share on other sites
cueclub 0 Posted August 9, 2010 I was trying to hav it save the position and size.. If i save it in 1 area, and then move the window to another area, I wanted it to move it back to the saved area. For some reason it was not working on my system. Share this post Link to post Share on other sites
Realm 18 Posted August 9, 2010 Maybe I misunderstood you question, are you wanting it to keep watching the window, and once moved to immediately place it back, or only when you click on the app? I had to click the app to move the window back. Also where you on MSN while testing, your $brow1 is title for that page. My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Share this post Link to post Share on other sites
1905russell 0 Posted August 9, 2010 Anyone have any ideas? Try - WinMove($Brow1, "", $pos[1], $pos[2], $size[1], $size[2]) Share this post Link to post Share on other sites
Realm 18 Posted August 10, 2010 Good Eye 1905russell My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Share this post Link to post Share on other sites
cueclub 0 Posted August 16, 2010 Try - WinMove($Brow1, "", $pos[1], $pos[2], $size[1], $size[2]) Ah I had forgotten about the [0] ,[1], [2] issues. I feel so dumb now. Thanks for the help Cue Share this post Link to post Share on other sites