ホーム › System.DataExchange › DdeQueryConvInfo
DdeQueryConvInfo
関数指定したDDE会話とトランザクションの情報を取得する。
シグネチャ
// USER32.dll
#include <windows.h>
DWORD DdeQueryConvInfo(
HCONV hConv,
DWORD idTransaction,
CONVINFO* pConvInfo
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hConv | HCONV | in |
| idTransaction | DWORD | in |
| pConvInfo | CONVINFO* | inout |
戻り値の型: DWORD
各言語での呼び出し定義
// USER32.dll
#include <windows.h>
DWORD DdeQueryConvInfo(
HCONV hConv,
DWORD idTransaction,
CONVINFO* pConvInfo
);[DllImport("USER32.dll", ExactSpelling = true)]
static extern uint DdeQueryConvInfo(
IntPtr hConv, // HCONV
uint idTransaction, // DWORD
IntPtr pConvInfo // CONVINFO* in/out
);<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function DdeQueryConvInfo(
hConv As IntPtr, ' HCONV
idTransaction As UInteger, ' DWORD
pConvInfo As IntPtr ' CONVINFO* in/out
) As UInteger
End Function' hConv : HCONV
' idTransaction : DWORD
' pConvInfo : CONVINFO* in/out
Declare PtrSafe Function DdeQueryConvInfo Lib "user32" ( _
ByVal hConv As LongPtr, _
ByVal idTransaction As Long, _
ByVal pConvInfo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DdeQueryConvInfo = ctypes.windll.user32.DdeQueryConvInfo
DdeQueryConvInfo.restype = wintypes.DWORD
DdeQueryConvInfo.argtypes = [
wintypes.HANDLE, # hConv : HCONV
wintypes.DWORD, # idTransaction : DWORD
ctypes.c_void_p, # pConvInfo : CONVINFO* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USER32.dll')
DdeQueryConvInfo = Fiddle::Function.new(
lib['DdeQueryConvInfo'],
[
Fiddle::TYPE_VOIDP, # hConv : HCONV
-Fiddle::TYPE_INT, # idTransaction : DWORD
Fiddle::TYPE_VOIDP, # pConvInfo : CONVINFO* in/out
],
-Fiddle::TYPE_INT)#[link(name = "user32")]
extern "system" {
fn DdeQueryConvInfo(
hConv: *mut core::ffi::c_void, // HCONV
idTransaction: u32, // DWORD
pConvInfo: *mut CONVINFO // CONVINFO* in/out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("USER32.dll")]
public static extern uint DdeQueryConvInfo(IntPtr hConv, uint idTransaction, IntPtr pConvInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_DdeQueryConvInfo' -Namespace Win32 -PassThru
# $api::DdeQueryConvInfo(hConv, idTransaction, pConvInfo)#uselib "USER32.dll"
#func global DdeQueryConvInfo "DdeQueryConvInfo" sptr, sptr, sptr
; DdeQueryConvInfo hConv, idTransaction, varptr(pConvInfo) ; 戻り値は stat
; hConv : HCONV -> "sptr"
; idTransaction : DWORD -> "sptr"
; pConvInfo : CONVINFO* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "USER32.dll" #cfunc global DdeQueryConvInfo "DdeQueryConvInfo" sptr, int, var ; res = DdeQueryConvInfo(hConv, idTransaction, pConvInfo) ; hConv : HCONV -> "sptr" ; idTransaction : DWORD -> "int" ; pConvInfo : CONVINFO* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "USER32.dll" #cfunc global DdeQueryConvInfo "DdeQueryConvInfo" sptr, int, sptr ; res = DdeQueryConvInfo(hConv, idTransaction, varptr(pConvInfo)) ; hConv : HCONV -> "sptr" ; idTransaction : DWORD -> "int" ; pConvInfo : CONVINFO* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD DdeQueryConvInfo(HCONV hConv, DWORD idTransaction, CONVINFO* pConvInfo) #uselib "USER32.dll" #cfunc global DdeQueryConvInfo "DdeQueryConvInfo" intptr, int, var ; res = DdeQueryConvInfo(hConv, idTransaction, pConvInfo) ; hConv : HCONV -> "intptr" ; idTransaction : DWORD -> "int" ; pConvInfo : CONVINFO* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD DdeQueryConvInfo(HCONV hConv, DWORD idTransaction, CONVINFO* pConvInfo) #uselib "USER32.dll" #cfunc global DdeQueryConvInfo "DdeQueryConvInfo" intptr, int, intptr ; res = DdeQueryConvInfo(hConv, idTransaction, varptr(pConvInfo)) ; hConv : HCONV -> "intptr" ; idTransaction : DWORD -> "int" ; pConvInfo : CONVINFO* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
user32 = windows.NewLazySystemDLL("USER32.dll")
procDdeQueryConvInfo = user32.NewProc("DdeQueryConvInfo")
)
// hConv (HCONV), idTransaction (DWORD), pConvInfo (CONVINFO* in/out)
r1, _, err := procDdeQueryConvInfo.Call(
uintptr(hConv),
uintptr(idTransaction),
uintptr(pConvInfo),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction DdeQueryConvInfo(
hConv: THandle; // HCONV
idTransaction: DWORD; // DWORD
pConvInfo: Pointer // CONVINFO* in/out
): DWORD; stdcall;
external 'USER32.dll' name 'DdeQueryConvInfo';result := DllCall("USER32\DdeQueryConvInfo"
, "Ptr", hConv ; HCONV
, "UInt", idTransaction ; DWORD
, "Ptr", pConvInfo ; CONVINFO* in/out
, "UInt") ; return: DWORD●DdeQueryConvInfo(hConv, idTransaction, pConvInfo) = DLL("USER32.dll", "dword DdeQueryConvInfo(void*, dword, void*)")
# 呼び出し: DdeQueryConvInfo(hConv, idTransaction, pConvInfo)
# hConv : HCONV -> "void*"
# idTransaction : DWORD -> "dword"
# pConvInfo : CONVINFO* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。