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

DdeQueryNextServer

関数
DDE会話リストから次のサーバー会話ハンドルを取得する。
DLLUSER32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

HCONV DdeQueryNextServer(
    HCONVLIST hConvList,
    HCONV hConvPrev
);

パラメーター

名前方向
hConvListHCONVLISTin
hConvPrevHCONVin

戻り値の型: HCONV

各言語での呼び出し定義

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

HCONV DdeQueryNextServer(
    HCONVLIST hConvList,
    HCONV hConvPrev
);
[DllImport("USER32.dll", ExactSpelling = true)]
static extern IntPtr DdeQueryNextServer(
    IntPtr hConvList,   // HCONVLIST
    IntPtr hConvPrev   // HCONV
);
<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function DdeQueryNextServer(
    hConvList As IntPtr,   ' HCONVLIST
    hConvPrev As IntPtr   ' HCONV
) As IntPtr
End Function
' hConvList : HCONVLIST
' hConvPrev : HCONV
Declare PtrSafe Function DdeQueryNextServer Lib "user32" ( _
    ByVal hConvList As LongPtr, _
    ByVal hConvPrev As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DdeQueryNextServer = ctypes.windll.user32.DdeQueryNextServer
DdeQueryNextServer.restype = ctypes.c_void_p
DdeQueryNextServer.argtypes = [
    wintypes.HANDLE,  # hConvList : HCONVLIST
    wintypes.HANDLE,  # hConvPrev : HCONV
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('USER32.dll')
DdeQueryNextServer = Fiddle::Function.new(
  lib['DdeQueryNextServer'],
  [
    Fiddle::TYPE_VOIDP,  # hConvList : HCONVLIST
    Fiddle::TYPE_VOIDP,  # hConvPrev : HCONV
  ],
  Fiddle::TYPE_VOIDP)
#[link(name = "user32")]
extern "system" {
    fn DdeQueryNextServer(
        hConvList: *mut core::ffi::c_void,  // HCONVLIST
        hConvPrev: *mut core::ffi::c_void  // HCONV
    ) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("USER32.dll")]
public static extern IntPtr DdeQueryNextServer(IntPtr hConvList, IntPtr hConvPrev);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_DdeQueryNextServer' -Namespace Win32 -PassThru
# $api::DdeQueryNextServer(hConvList, hConvPrev)
#uselib "USER32.dll"
#func global DdeQueryNextServer "DdeQueryNextServer" sptr, sptr
; DdeQueryNextServer hConvList, hConvPrev   ; 戻り値は stat
; hConvList : HCONVLIST -> "sptr"
; hConvPrev : HCONV -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "USER32.dll"
#cfunc global DdeQueryNextServer "DdeQueryNextServer" sptr, sptr
; res = DdeQueryNextServer(hConvList, hConvPrev)
; hConvList : HCONVLIST -> "sptr"
; hConvPrev : HCONV -> "sptr"
; HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev)
#uselib "USER32.dll"
#cfunc global DdeQueryNextServer "DdeQueryNextServer" intptr, intptr
; res = DdeQueryNextServer(hConvList, hConvPrev)
; hConvList : HCONVLIST -> "intptr"
; hConvPrev : HCONV -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	user32 = windows.NewLazySystemDLL("USER32.dll")
	procDdeQueryNextServer = user32.NewProc("DdeQueryNextServer")
)

// hConvList (HCONVLIST), hConvPrev (HCONV)
r1, _, err := procDdeQueryNextServer.Call(
	uintptr(hConvList),
	uintptr(hConvPrev),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HCONV
function DdeQueryNextServer(
  hConvList: THandle;   // HCONVLIST
  hConvPrev: THandle   // HCONV
): THandle; stdcall;
  external 'USER32.dll' name 'DdeQueryNextServer';
result := DllCall("USER32\DdeQueryNextServer"
    , "Ptr", hConvList   ; HCONVLIST
    , "Ptr", hConvPrev   ; HCONV
    , "Ptr")   ; return: HCONV
●DdeQueryNextServer(hConvList, hConvPrev) = DLL("USER32.dll", "void* DdeQueryNextServer(void*, void*)")
# 呼び出し: DdeQueryNextServer(hConvList, hConvPrev)
# hConvList : HCONVLIST -> "void*"
# hConvPrev : HCONV -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。