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

RtwqRegisterPlatformEvents

関数
RTWQプラットフォームのイベント通知コールバックを登録する。
DLLRTWorkQ.dll呼出規約winapi対応OSWindows 8.1 以降

シグネチャ

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

HRESULT RtwqRegisterPlatformEvents(
    IRtwqPlatformEvents* platformEvents
);

パラメーター

名前方向
platformEventsIRtwqPlatformEvents*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

RtwqRegisterPlatformEvents = ctypes.windll.rtworkq.RtwqRegisterPlatformEvents
RtwqRegisterPlatformEvents.restype = ctypes.c_int
RtwqRegisterPlatformEvents.argtypes = [
    ctypes.c_void_p,  # platformEvents : IRtwqPlatformEvents*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rtworkq = windows.NewLazySystemDLL("RTWorkQ.dll")
	procRtwqRegisterPlatformEvents = rtworkq.NewProc("RtwqRegisterPlatformEvents")
)

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