本帖最后由 zerobin 于 2012-6-14 14:54 编辑
晕,原来我想错了。
是这样的。#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
$hGUI = GUICreate("label双击", 400, 400)
$hLabel = GUICtrlCreateLabel("单击没用,双击我看看!", 100, 150, 200, 50, BitOr($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetBkColor(-1, 0xcccc00)
GUISetState()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Func WM_COMMAND($hWnd, $MsgID, $wParam, $lParam)
Local Const $STN_DBLCLK = 1
Local $nID = BitAND($wParam, 0xFFFF)
Local $nNotifyCode = BitShift($wParam, 16)
If $nID = $hlabel And $nNotifyCode = $STN_DBLCLK Then
MsgBox(0, "双击", "也! 成功!")
EndIf
Return $GUI_RUNDEFMSG
EndFunc
|