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