maqleod Posted June 14, 2007 Posted June 14, 2007 (edited) here's a piece of a script you can add into anything with a gui to have it open at the same location it was closed. Nothing special, just thought some might find it handy. #include <GUIConstants.au3> $xpos = RegRead("HKEY_CURRENT_USER\SOFTWARE\AutoItTest", "Xpos") if $xpos = 1 OR $xpos = -32000 then RegWrite("HKEY_CURRENT_USER\SOFTWARE\AutoItTest","Xpos","REG_SZ",-1) $xpos = RegRead("HKEY_CURRENT_USER\SOFTWARE\AutoItTest", "Xpos") endif $ypos = RegRead("HKEY_CURRENT_USER\SOFTWARE\AutoItTest", "Ypos") if $ypos = 1 OR $ypos = -32000 then RegWrite("HKEY_CURRENT_USER\SOFTWARE\AutoItTest","Ypos","REG_SZ",-1) $ypos = RegRead("HKEY_CURRENT_USER\SOFTWARE\AutoItTest", "Ypos") endif $parent = GUICreate("test",195,175,$xpos,$ypos,-1,-1) GUISetState() Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE $newpos = WinGetPos("test","") RegWrite("HKEY_CURRENT_USER\SOFTWARE\AutoItTest","Xpos","REG_SZ",$newpos[0]) RegWrite("HKEY_CURRENT_USER\SOFTWARE\AutoItTest","Ypos","REG_SZ",$newpos[1]) GUIDelete() Edited June 14, 2007 by maqleod [u]You can download my projects at:[/u] Pulsar Software
zfisherdrums Posted June 14, 2007 Posted June 14, 2007 Cool! Hooray persistency! Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog...
star2 Posted June 14, 2007 Posted June 14, 2007 I like using the registry so much nice example see ya [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]
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