本帖最后由 liuyilun 于 2017-8-9 15:17 编辑
代码如下想保存窗口大小,但是每次打开窗口大小都会变大,求大大们帮帮忙#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include-once
$Sizex = IniRead(@AppDataDir & "\Config.ini", "Size", "x", "error")
$Sizey = IniRead(@AppDataDir & "\Config.ini", "Size", "y", "error")
$Form1 = GUICreate("文件选择", $Sizex, $Sizey, -1, -1,$WS_OVERLAPPEDWINDOW)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
$pos = WinGetPos($Form1)
IniWrite(@AppDataDir & "\Config.ini", "Size", "x", $pos[2])
IniWrite(@AppDataDir & "\Config.ini", "Size", "y", $pos[3])
Exit
EndSwitch
WEnd
|