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

MQCloseCursor

関数
キューカーソルを閉じる。
DLLmqrt.dll呼出規約winapi

シグネチャ

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

HRESULT MQCloseCursor(
    HANDLE hCursor
);

パラメーター

名前方向
hCursorHANDLEin

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

MQCloseCursor = ctypes.windll.mqrt.MQCloseCursor
MQCloseCursor.restype = ctypes.c_int
MQCloseCursor.argtypes = [
    wintypes.HANDLE,  # hCursor : HANDLE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mqrt = windows.NewLazySystemDLL("mqrt.dll")
	procMQCloseCursor = mqrt.NewProc("MQCloseCursor")
)

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