函数参考


_WinAPI_SetMessageExtraInfo

Sets the extra message information for the current thread.

#Include <WinAPIEx.au3>
_WinAPI_SetMessageExtraInfo ( $lParam )

参数

$lParam The value of LPARAM type to be associated with the current thread.

返回值

Success The previous value associated with the current thread.
失败: 返回 0 并设置 @error 标志为非 0 值.

注意/说明

None

相关

详情参考

在MSDN中搜索


示例/演示


#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global Const $WM_MYMESSAGE = _WinAPI_RegisterWindowMessage('MyMessage')

Global $hForm, $Msg, $Button, $Input, $pString

$hForm = GUICreate('MyGUI', 400, 93)
$Input = GUICtrlCreateInput('', 20, 20, 360, 20)
$Button = GUICtrlCreateButton('Send', 165, 59, 70, 23)
GUIRegisterMsg($WM_MYMESSAGE, 'WM_MYMESSAGE')
GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case -3
            ExitLoop
        Case $Button
            $pString = _WinAPI_CreateString(GUICtrlRead($Input))
            _WinAPI_SetMessageExtraInfo($pString)
            _SendMessage($hForm, $WM_MYMESSAGE, 1, 255)
            _WinAPI_FreeMemory($pString)
    EndSwitch
WEnd

Func WM_MYMESSAGE($hWnd, $iMsg, $wParam, $lParam)

    Local $pString = _WinAPI_GetMessageExtraInfo()

    If _WinAPI_IsMemory($pString) Then
        ConsoleWrite('WM_MYMESSAGE | WP = ' & Number($wParam) & ' | LP = ' & Number($lParam) & ' | EXTRA = "' & _WinAPI_GetString($pString) & '"' & @CR)
    EndIf
EndFunc   ;==>WM_MYMESSAGE