估计你是想要这个效果吧
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Winapi.au3>
Global Const $SC_MOVE = 0xF010
$Form1 = GUICreate("", 348, 195, 451, 409, $WS_POPUP)
Global $i = GUICtrlCreatePic("1.bmp", -1, 90)
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
$wProcOld = GUIRegisterMsgEx($i, "_MyWindowProc") ;窗口子类化
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func GUIRegisterMsgEx($ctrID, $funcName) ;控件id,函数名
Local $wProcNew = DllCallbackRegister($funcName, "ptr", "hwnd;uint;long;ptr")
Local $wProcOld = _WinAPI_SetWindowLong(GUICtrlGetHandle($ctrID), -4, DllCallbackGetPtr($wProcNew))
Return $wProcOld
EndFunc ;==>GUIRegisterMsgEx
Func _MyWindowProc($hWnd, $uiMsg, $wParam, $lParam)
Switch $uiMsg
Case 512 ;$WM_MOUSEMOVE
If ($wParam=0x0001) Then
_SendMessage($Form1, $WM_SYSCOMMAND, $SC_MOVE + $HTCAPTION, 0)
EndIf
EndSwitch
;向默认窗口进程传递未处理过的消息
Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $uiMsg, $wParam, $lParam)
EndFunc ;==>_MyWindowProc
Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
If ($hWnd = $Form1) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION
EndFunc ;==>WM_NCHITTEST
|