暂时找不到其它方法,就先用NCHITTEST来侦测吧
#include <WindowsConstants.au3>
#include <array.au3>
$Form1 = GUICreate("父窗口", 600, 450, -1, -1, "")
$Group1 = GUICtrlCreateGroup("", 10, 5, 580, 65)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("一系列按钮", 53, 20, 112, 40)
$Form2 = GUICreate("Login", 505, 270, 45, 80, BitOR($WS_CHILD, $WS_TABSTOP), $WS_EX_CONTROLPARENT, $Form1)
GUISetBkColor(0xCCCCFF);这个子窗口蓝色区域能拖动(鼠标左键按住,就能拖来拖去,而父窗口没有移动,为什么)
$2input1 = GUICtrlCreateInput("", 140, 40, 320, 25)
$2label_l1 = GUICtrlCreateLabel("能拖动:", 40, 44, 100, 28)
$2input2 = GUICtrlCreateInput("", 140, 140, 320, 25)
$2label_l1 = GUICtrlCreateLabel("tab键切换不到:", 40, 144, 100, 28)
GUISetState(@SW_SHOW, $Form1)
GUISetState(@SW_SHOW, $Form2)
GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST')
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
EndSwitch
WEnd
Func WM_NCHITTEST($hWnd, $Msg, $wParam, $lParam)
Switch $hWnd
Case $Form2
Return $HTCLIENT
EndSwitch
EndFunc ;==>WM_NCHITTEST
|