#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("窗体1", 410, 200, 300, 240, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SYSMENU, $WS_GROUP, $WS_TABSTOP))
$i = WinGetClientSize($Form1)
$Pic1 = GUICtrlCreatePic("g:\oem.jpg", 20, 20, $i[0] - 40, 100)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
;Case $GUI_EVENT_MINIMIZE;最小化窗口按钮
Case $GUI_EVENT_RESTORE;还原窗口按钮
$i = WinGetClientSize($Form1)
GUICtrlSetPos($Pic1, 20, 20, $i[0] - 40, 100)
Case $GUI_EVENT_MAXIMIZE;最大化窗口按钮
$i = WinGetClientSize($Form1)
GUICtrlSetPos($Pic1, 20, 20, $i[0] - 40, 100)
EndSwitch
WEnd
我只能帮你这样做了。也许P版有更好的办法 |