#Include <Misc.au3>
#include <WinApi.au3>
Local Const $SPI_GETWORKAREA = 0x0030
Local Const $SPI_SETWORKAREA = 0x002F
Local $stRect = DllStructCreate($tagRect);旧的矩形范围
Local $stRectNew = DllStructCreate($tagRect);新的矩形范围
Local $iResult = _WinAPI_SystemParametersInfo($SPI_GETWORKAREA, 0, DllStructGetPtr($stRect), 0)
;~ If $iResult Then
;~ MsgBox(0, "Desktop Working Area", "Left = " & _
;~ DllStructGetData($stRect, "left") & @CRLF & "Top = " & _
;~ DllStructGetData($stRect, "top") & @CRLF & "Right = " & _
;~ DllStructGetData($stRect, "right") & @CRLF & "Bottom = " & _
;~ DllStructGetData($stRect, "bottom"))
;~ Else
;~ MsgBox(0, "Desktop Working Area", "Faild to get Desktop work area")
;~ EndIf
;上下左右减小20像素
DllStructSetData($stRectNew, "left", DllStructGetData($stRect, "left") + 20)
DllStructSetData($stRectNew, "top", DllStructGetData($stRect, "top") + 20)
DllStructSetData($stRectNew, "right", DllStructGetData($stRect, "right") - 20)
DllStructSetData($stRectNew, "bottom", DllStructGetData($stRect, "bottom") - 20)
_WinAPI_SystemParametersInfo($SPI_SETWORKAREA, 0, DllStructGetPtr($stRectNew), 0)
TrayTip("说明","现在你可以打开一个窗口(比如记事本)然后最大化,看看最大化的效果!,按空格键退出!", 5)
Do
Sleep(10)
Until _IsPressed(20);等待按空格键,等待任意键不会写
_WinAPI_SystemParametersInfo($SPI_SETWORKAREA, 0, DllStructGetPtr($stRect), 0)
|