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

DdeFreeDataHandle

関数
指定したDDEデータハンドルを解放する。
DLLUSER32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

BOOL DdeFreeDataHandle(
    HDDEDATA hData
);

パラメーター

名前方向
hDataHDDEDATAin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL DdeFreeDataHandle(
    HDDEDATA hData
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", ExactSpelling = true)]
static extern bool DdeFreeDataHandle(
    IntPtr hData   // HDDEDATA
);
<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function DdeFreeDataHandle(
    hData As IntPtr   ' HDDEDATA
) As Boolean
End Function
' hData : HDDEDATA
Declare PtrSafe Function DdeFreeDataHandle Lib "user32" ( _
    ByVal hData As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DdeFreeDataHandle = ctypes.windll.user32.DdeFreeDataHandle
DdeFreeDataHandle.restype = wintypes.BOOL
DdeFreeDataHandle.argtypes = [
    wintypes.HANDLE,  # hData : HDDEDATA
]
require 'fiddle'
require 'fiddle/import'

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

var (
	user32 = windows.NewLazySystemDLL("USER32.dll")
	procDdeFreeDataHandle = user32.NewProc("DdeFreeDataHandle")
)

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