|
求教高手帮忙看看..我这是那错了.. 不加移动窗口的话. 点一下就可以关闭..加移动窗口的话..要双击才能关闭..
这是我加移动窗口的:
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
If ($hWnd = $MainGUI) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION
EndFunc ;==>WM_NCHITTEST
问题在下面::不知道是那个环节出错了.
$MousePos = GUIGetCursorInfo($MainGUI) ;获取(相对于 GUI 窗口的)鼠标位置.
$WinPos = WinGetPos($MainGUI) ;获取指定窗口的坐标位置和大小等属性.
;关闭窗口
If BitAND($MousePos[0]<=427,$MousePos[0]>=417,$MousePos[1]<=28,$MousePos[1]>=18) Then
$ThisCtrlID = 1
Else
$ThisCtrlID = 0
EndIf
If $LastCtrlID <> $ThisCtrlID Then
Switch $ThisCtrlID
Case 1
$ImageState[1] = 2
Case 0
$ImageState[1] = 1
EndSwitch
_SetTotalBitmap()
$LastCtrlID = $ThisCtrlID
EndIf
If $MousePos[2] And $ThisCtrlID = 1 Then
$ImageState[1] = 3
_SetTotalBitmap()
While $MousePos[2]
$MousePos = GUIGetCursorInfo($MainGUI)
WEnd
If BitAND($MousePos[0]<=427,$MousePos[0]>=417,$MousePos[1]<=28,$MousePos[1]>=18) Then
$ThisCtrlID = 1
exit
Else
$ThisCtrlID = 0
$ImageState[1] = 1
_SetTotalBitmap()
EndIf
EndIf |
|