Win32 API 日本語リファレンス
ホームStorage.Jet › JetGetCursorInfo

JetGetCursorInfo

関数
テーブルカーソルに関する情報を取得する。
DLLESENT.dll呼出規約winapi

シグネチャ

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

INT JetGetCursorInfo(
    JET_SESID sesid,
    JET_TABLEID tableid,
    void* pvResult,
    DWORD cbMax,
    DWORD InfoLevel
);

パラメーター

名前方向
sesidJET_SESIDin
tableidJET_TABLEIDin
pvResultvoid*out
cbMaxDWORDin
InfoLevelDWORDin

戻り値の型: INT

各言語での呼び出し定義

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

INT JetGetCursorInfo(
    JET_SESID sesid,
    JET_TABLEID tableid,
    void* pvResult,
    DWORD cbMax,
    DWORD InfoLevel
);
[DllImport("ESENT.dll", ExactSpelling = true)]
static extern int JetGetCursorInfo(
    UIntPtr sesid,   // JET_SESID
    UIntPtr tableid,   // JET_TABLEID
    IntPtr pvResult,   // void* out
    uint cbMax,   // DWORD
    uint InfoLevel   // DWORD
);
<DllImport("ESENT.dll", ExactSpelling:=True)>
Public Shared Function JetGetCursorInfo(
    sesid As UIntPtr,   ' JET_SESID
    tableid As UIntPtr,   ' JET_TABLEID
    pvResult As IntPtr,   ' void* out
    cbMax As UInteger,   ' DWORD
    InfoLevel As UInteger   ' DWORD
) As Integer
End Function
' sesid : JET_SESID
' tableid : JET_TABLEID
' pvResult : void* out
' cbMax : DWORD
' InfoLevel : DWORD
Declare PtrSafe Function JetGetCursorInfo Lib "esent" ( _
    ByVal sesid As LongPtr, _
    ByVal tableid As LongPtr, _
    ByVal pvResult As LongPtr, _
    ByVal cbMax As Long, _
    ByVal InfoLevel As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

JetGetCursorInfo = ctypes.windll.esent.JetGetCursorInfo
JetGetCursorInfo.restype = ctypes.c_int
JetGetCursorInfo.argtypes = [
    ctypes.c_size_t,  # sesid : JET_SESID
    ctypes.c_size_t,  # tableid : JET_TABLEID
    ctypes.POINTER(None),  # pvResult : void* out
    wintypes.DWORD,  # cbMax : DWORD
    wintypes.DWORD,  # InfoLevel : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ESENT.dll')
JetGetCursorInfo = Fiddle::Function.new(
  lib['JetGetCursorInfo'],
  [
    Fiddle::TYPE_UINTPTR_T,  # sesid : JET_SESID
    Fiddle::TYPE_UINTPTR_T,  # tableid : JET_TABLEID
    Fiddle::TYPE_VOIDP,  # pvResult : void* out
    -Fiddle::TYPE_INT,  # cbMax : DWORD
    -Fiddle::TYPE_INT,  # InfoLevel : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "esent")]
extern "system" {
    fn JetGetCursorInfo(
        sesid: usize,  // JET_SESID
        tableid: usize,  // JET_TABLEID
        pvResult: *mut (),  // void* out
        cbMax: u32,  // DWORD
        InfoLevel: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ESENT.dll")]
public static extern int JetGetCursorInfo(UIntPtr sesid, UIntPtr tableid, IntPtr pvResult, uint cbMax, uint InfoLevel);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ESENT_JetGetCursorInfo' -Namespace Win32 -PassThru
# $api::JetGetCursorInfo(sesid, tableid, pvResult, cbMax, InfoLevel)
#uselib "ESENT.dll"
#func global JetGetCursorInfo "JetGetCursorInfo" sptr, sptr, sptr, sptr, sptr
; JetGetCursorInfo sesid, tableid, pvResult, cbMax, InfoLevel   ; 戻り値は stat
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; pvResult : void* out -> "sptr"
; cbMax : DWORD -> "sptr"
; InfoLevel : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ESENT.dll"
#cfunc global JetGetCursorInfo "JetGetCursorInfo" sptr, sptr, sptr, int, int
; res = JetGetCursorInfo(sesid, tableid, pvResult, cbMax, InfoLevel)
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; pvResult : void* out -> "sptr"
; cbMax : DWORD -> "int"
; InfoLevel : DWORD -> "int"
; INT JetGetCursorInfo(JET_SESID sesid, JET_TABLEID tableid, void* pvResult, DWORD cbMax, DWORD InfoLevel)
#uselib "ESENT.dll"
#cfunc global JetGetCursorInfo "JetGetCursorInfo" intptr, intptr, intptr, int, int
; res = JetGetCursorInfo(sesid, tableid, pvResult, cbMax, InfoLevel)
; sesid : JET_SESID -> "intptr"
; tableid : JET_TABLEID -> "intptr"
; pvResult : void* out -> "intptr"
; cbMax : DWORD -> "int"
; InfoLevel : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	esent = windows.NewLazySystemDLL("ESENT.dll")
	procJetGetCursorInfo = esent.NewProc("JetGetCursorInfo")
)

// sesid (JET_SESID), tableid (JET_TABLEID), pvResult (void* out), cbMax (DWORD), InfoLevel (DWORD)
r1, _, err := procJetGetCursorInfo.Call(
	uintptr(sesid),
	uintptr(tableid),
	uintptr(pvResult),
	uintptr(cbMax),
	uintptr(InfoLevel),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function JetGetCursorInfo(
  sesid: NativeUInt;   // JET_SESID
  tableid: NativeUInt;   // JET_TABLEID
  pvResult: Pointer;   // void* out
  cbMax: DWORD;   // DWORD
  InfoLevel: DWORD   // DWORD
): Integer; stdcall;
  external 'ESENT.dll' name 'JetGetCursorInfo';
result := DllCall("ESENT\JetGetCursorInfo"
    , "UPtr", sesid   ; JET_SESID
    , "UPtr", tableid   ; JET_TABLEID
    , "Ptr", pvResult   ; void* out
    , "UInt", cbMax   ; DWORD
    , "UInt", InfoLevel   ; DWORD
    , "Int")   ; return: INT
●JetGetCursorInfo(sesid, tableid, pvResult, cbMax, InfoLevel) = DLL("ESENT.dll", "int JetGetCursorInfo(int, int, void*, dword, dword)")
# 呼び出し: JetGetCursorInfo(sesid, tableid, pvResult, cbMax, InfoLevel)
# sesid : JET_SESID -> "int"
# tableid : JET_TABLEID -> "int"
# pvResult : void* out -> "void*"
# cbMax : DWORD -> "dword"
# InfoLevel : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。