Sign in to follow this  
Followers 0
epicfail

save WinGetPos to ini

4 posts in this topic

hi im trying to save WinGetPos to a ini and then make my gui load it when it starts so that my gui goes to the place it was draged to. But the problem im having is that its not going to the place i left it when i exited the script its going half of the screen in the top left corner. Can some 1 helpme please?

$positionX = IniRead(@ScriptDir & "\settinngs.ini", "Window position", "X", "")
$positionY = IniRead(@ScriptDir & "\settings.ini", "Window position", "Y", "")

$Form1 = GUICreate("Form1", 338, 258, $positionX, $positionY, BitOR( $WS_POPUP, $WS_GROUP, $WS_CLIPSIBLINGS))

$Pos = WinGetPos($Form1)
    IniWrite(@ScriptDir & "\settings.ini", "Window position", "X", $Pos[0])
    IniWrite(@ScriptDir & "\settings.ini", "Window position", "Y", $Pos[1])

Share this post


Link to post
Share on other sites



Try

$positionX = IniRead(@ScriptDir & "\settings.ini", "Window position", "X", "")
$positionY = IniRead(@ScriptDir & "\settings.ini", "Window position", "Y", "")

$Form1 = GUICreate("Form1", 338, 258, $positionX, $positionY, BitOR( $WS_POPUP, $WS_GROUP, $WS_CLIPSIBLINGS))

$Pos = WinGetPos($Form1)
    IniWrite(@ScriptDir & "\settings.ini", "Window position", "X", $Pos[0])
    IniWrite(@ScriptDir & "\settings.ini", "Window position", "Y", $Pos[1])

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

lol sorry i have it working now i had a prob with ofsets

Share this post


Link to post
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
Sign in to follow this  
Followers 0