Win32 API 日本語リファレンス
ホームSystem.DataExchange › ReuseDDElParam

ReuseDDElParam

関数
DDEメッセージのlParamを再利用して別メッセージ用に再構成する。
DLLUSER32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// USER32.dll
#include <windows.h>

LPARAM ReuseDDElParam(
    LPARAM lParam,
    DWORD msgIn,
    DWORD msgOut,
    UINT_PTR uiLo,
    UINT_PTR uiHi
);

パラメーター

名前方向
lParamLPARAMin
msgInDWORDin
msgOutDWORDin
uiLoUINT_PTRin
uiHiUINT_PTRin

戻り値の型: LPARAM

各言語での呼び出し定義

// USER32.dll
#include <windows.h>

LPARAM ReuseDDElParam(
    LPARAM lParam,
    DWORD msgIn,
    DWORD msgOut,
    UINT_PTR uiLo,
    UINT_PTR uiHi
);
[DllImport("USER32.dll", ExactSpelling = true)]
static extern IntPtr ReuseDDElParam(
    IntPtr lParam,   // LPARAM
    uint msgIn,   // DWORD
    uint msgOut,   // DWORD
    UIntPtr uiLo,   // UINT_PTR
    UIntPtr uiHi   // UINT_PTR
);
<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function ReuseDDElParam(
    lParam As IntPtr,   ' LPARAM
    msgIn As UInteger,   ' DWORD
    msgOut As UInteger,   ' DWORD
    uiLo As UIntPtr,   ' UINT_PTR
    uiHi As UIntPtr   ' UINT_PTR
) As IntPtr
End Function
' lParam : LPARAM
' msgIn : DWORD
' msgOut : DWORD
' uiLo : UINT_PTR
' uiHi : UINT_PTR
Declare PtrSafe Function ReuseDDElParam Lib "user32" ( _
    ByVal lParam As LongPtr, _
    ByVal msgIn As Long, _
    ByVal msgOut As Long, _
    ByVal uiLo As LongPtr, _
    ByVal uiHi As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ReuseDDElParam = ctypes.windll.user32.ReuseDDElParam
ReuseDDElParam.restype = ctypes.c_ssize_t
ReuseDDElParam.argtypes = [
    ctypes.c_ssize_t,  # lParam : LPARAM
    wintypes.DWORD,  # msgIn : DWORD
    wintypes.DWORD,  # msgOut : DWORD
    ctypes.c_size_t,  # uiLo : UINT_PTR
    ctypes.c_size_t,  # uiHi : UINT_PTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('USER32.dll')
ReuseDDElParam = Fiddle::Function.new(
  lib['ReuseDDElParam'],
  [
    Fiddle::TYPE_INTPTR_T,  # lParam : LPARAM
    -Fiddle::TYPE_INT,  # msgIn : DWORD
    -Fiddle::TYPE_INT,  # msgOut : DWORD
    Fiddle::TYPE_UINTPTR_T,  # uiLo : UINT_PTR
    Fiddle::TYPE_UINTPTR_T,  # uiHi : UINT_PTR
  ],
  Fiddle::TYPE_INTPTR_T)
#[link(name = "user32")]
extern "system" {
    fn ReuseDDElParam(
        lParam: isize,  // LPARAM
        msgIn: u32,  // DWORD
        msgOut: u32,  // DWORD
        uiLo: usize,  // UINT_PTR
        uiHi: usize  // UINT_PTR
    ) -> isize;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("USER32.dll")]
public static extern IntPtr ReuseDDElParam(IntPtr lParam, uint msgIn, uint msgOut, UIntPtr uiLo, UIntPtr uiHi);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_ReuseDDElParam' -Namespace Win32 -PassThru
# $api::ReuseDDElParam(lParam, msgIn, msgOut, uiLo, uiHi)
#uselib "USER32.dll"
#func global ReuseDDElParam "ReuseDDElParam" sptr, sptr, sptr, sptr, sptr
; ReuseDDElParam lParam, msgIn, msgOut, uiLo, uiHi   ; 戻り値は stat
; lParam : LPARAM -> "sptr"
; msgIn : DWORD -> "sptr"
; msgOut : DWORD -> "sptr"
; uiLo : UINT_PTR -> "sptr"
; uiHi : UINT_PTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "USER32.dll"
#cfunc global ReuseDDElParam "ReuseDDElParam" sptr, int, int, sptr, sptr
; res = ReuseDDElParam(lParam, msgIn, msgOut, uiLo, uiHi)
; lParam : LPARAM -> "sptr"
; msgIn : DWORD -> "int"
; msgOut : DWORD -> "int"
; uiLo : UINT_PTR -> "sptr"
; uiHi : UINT_PTR -> "sptr"
; LPARAM ReuseDDElParam(LPARAM lParam, DWORD msgIn, DWORD msgOut, UINT_PTR uiLo, UINT_PTR uiHi)
#uselib "USER32.dll"
#cfunc global ReuseDDElParam "ReuseDDElParam" intptr, int, int, intptr, intptr
; res = ReuseDDElParam(lParam, msgIn, msgOut, uiLo, uiHi)
; lParam : LPARAM -> "intptr"
; msgIn : DWORD -> "int"
; msgOut : DWORD -> "int"
; uiLo : UINT_PTR -> "intptr"
; uiHi : UINT_PTR -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	user32 = windows.NewLazySystemDLL("USER32.dll")
	procReuseDDElParam = user32.NewProc("ReuseDDElParam")
)

// lParam (LPARAM), msgIn (DWORD), msgOut (DWORD), uiLo (UINT_PTR), uiHi (UINT_PTR)
r1, _, err := procReuseDDElParam.Call(
	uintptr(lParam),
	uintptr(msgIn),
	uintptr(msgOut),
	uintptr(uiLo),
	uintptr(uiHi),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // LPARAM
function ReuseDDElParam(
  lParam: NativeInt;   // LPARAM
  msgIn: DWORD;   // DWORD
  msgOut: DWORD;   // DWORD
  uiLo: NativeUInt;   // UINT_PTR
  uiHi: NativeUInt   // UINT_PTR
): NativeInt; stdcall;
  external 'USER32.dll' name 'ReuseDDElParam';
result := DllCall("USER32\ReuseDDElParam"
    , "Ptr", lParam   ; LPARAM
    , "UInt", msgIn   ; DWORD
    , "UInt", msgOut   ; DWORD
    , "UPtr", uiLo   ; UINT_PTR
    , "UPtr", uiHi   ; UINT_PTR
    , "Ptr")   ; return: LPARAM
●ReuseDDElParam(lParam, msgIn, msgOut, uiLo, uiHi) = DLL("USER32.dll", "int ReuseDDElParam(int, dword, dword, int, int)")
# 呼び出し: ReuseDDElParam(lParam, msgIn, msgOut, uiLo, uiHi)
# lParam : LPARAM -> "int"
# msgIn : DWORD -> "dword"
# msgOut : DWORD -> "dword"
# uiLo : UINT_PTR -> "int"
# uiHi : UINT_PTR -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。