|
发表于 2015-3-21 22:00:12
|
显示全部楼层
回复 48# kk_lee69
帮助文件里的代码:
---------------------------------------------------------------------------
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $k = 0
$Gui = GUICreate("WM_SIZE", 370, 140, -1, -1, $WS_OVERLAPPEDWINDOW)
GUICtrlCreateLabel('调整窗口大小时发送 WM_SIZE 消息. 可以设置某些特定的调整条件.', 5, 5, 360, 130)
GUISetState()
GUIRegisterMsg($WM_SIZE, "WM_SIZE")
Do
Until GUIGetMsg() = -3
Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
#forceref $Msg, $wParam
Local $w, $h
; 窗口客户区的尺寸.
$w = BitAND($lParam, 0xFFFF) ; _WinAPI_LoWord 低位字
$h = BitShift($lParam, 16) ; _WinAPI_HiWord 高位字
$k += 1
WinSetTitle($Gui, '', '消息发生次数: ' & $k & ' 宽 = ' & $w & ', 高 = ' & $h)
Return $GUI_RUNDEFMSG
EndFunc
--------------------------------------------------------------------------- |
|