Win32 API 日本語リファレンス
ホームNetworkManagement.P2P › DrtUnregisterKey

DrtUnregisterKey

関数
DRTに登録したキーを登録解除する。
DLLdrt.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

void DrtUnregisterKey(
    void* hKeyRegistration
);

パラメーター

名前方向
hKeyRegistrationvoid*in

戻り値の型: void

各言語での呼び出し定義

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

void DrtUnregisterKey(
    void* hKeyRegistration
);
[DllImport("drt.dll", ExactSpelling = true)]
static extern void DrtUnregisterKey(
    IntPtr hKeyRegistration   // void*
);
<DllImport("drt.dll", ExactSpelling:=True)>
Public Shared Sub DrtUnregisterKey(
    hKeyRegistration As IntPtr   ' void*
)
End Sub
' hKeyRegistration : void*
Declare PtrSafe Sub DrtUnregisterKey Lib "drt" ( _
    ByVal hKeyRegistration As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DrtUnregisterKey = ctypes.windll.drt.DrtUnregisterKey
DrtUnregisterKey.restype = None
DrtUnregisterKey.argtypes = [
    ctypes.POINTER(None),  # hKeyRegistration : void*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('drt.dll')
DrtUnregisterKey = Fiddle::Function.new(
  lib['DrtUnregisterKey'],
  [
    Fiddle::TYPE_VOIDP,  # hKeyRegistration : void*
  ],
  Fiddle::TYPE_VOID)
#[link(name = "drt")]
extern "system" {
    fn DrtUnregisterKey(
        hKeyRegistration: *mut ()  // void*
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("drt.dll")]
public static extern void DrtUnregisterKey(IntPtr hKeyRegistration);
"@
$api = Add-Type -MemberDefinition $sig -Name 'drt_DrtUnregisterKey' -Namespace Win32 -PassThru
# $api::DrtUnregisterKey(hKeyRegistration)
#uselib "drt.dll"
#func global DrtUnregisterKey "DrtUnregisterKey" sptr
; DrtUnregisterKey hKeyRegistration
; hKeyRegistration : void* -> "sptr"
#uselib "drt.dll"
#func global DrtUnregisterKey "DrtUnregisterKey" sptr
; DrtUnregisterKey hKeyRegistration
; hKeyRegistration : void* -> "sptr"
; void DrtUnregisterKey(void* hKeyRegistration)
#uselib "drt.dll"
#func global DrtUnregisterKey "DrtUnregisterKey" intptr
; DrtUnregisterKey hKeyRegistration
; hKeyRegistration : void* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	drt = windows.NewLazySystemDLL("drt.dll")
	procDrtUnregisterKey = drt.NewProc("DrtUnregisterKey")
)

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