Jump to content

save WinGetPos to ini


epicfail
 Share

Recommended Posts

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])
Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...