Win32 API 日本語リファレンス
ホームUI.WindowsAndMessaging › DestroyAcceleratorTable

DestroyAcceleratorTable

関数
アクセラレータテーブルを破棄する。
DLLUSER32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

BOOL DestroyAcceleratorTable(
    HACCEL hAccel
);

パラメーター

名前方向
hAccelHACCELin

戻り値の型: BOOL

各言語での呼び出し定義

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

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

DestroyAcceleratorTable = ctypes.windll.user32.DestroyAcceleratorTable
DestroyAcceleratorTable.restype = wintypes.BOOL
DestroyAcceleratorTable.argtypes = [
    wintypes.HANDLE,  # hAccel : HACCEL
]
require 'fiddle'
require 'fiddle/import'

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

var (
	user32 = windows.NewLazySystemDLL("USER32.dll")
	procDestroyAcceleratorTable = user32.NewProc("DestroyAcceleratorTable")
)

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