本帖最后由 happytc 于 2011-8-12 11:04 编辑
#Include <WinAPI.au3>
Local $NewMsg, $hGui, $sParam, $tStruct
$NewMsg = _WinAPI_RegisterWindowMessage("NewMsg")
$hGui = GUICreate("Test Msg")
GUIRegisterMsg($NewMsg, "My_New_Message")
$sParam = "It's New Msg"
$tStruct = DllStructCreate('wchar[' & String(StringLen($sParam) + 1) & ']')
DllStructSetData($tStruct, 1, $sParam)
_WinAPI_PostMessage($hGui, $NewMsg, DllStructGetPtr($tStruct), DllStructGetSize($tStruct) / 2)
While True
Sleep(10)
WEnd
Func My_New_Message($hWnd, $Msg, $wParam, $lParam)
local $mStruct = DllStructCreate('wchar[' & Number($lParam) & ']', $wParam)
MsgBox(0, 'New Test', DllStructGetData($mStruct, 1))
EndFunc
|