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

CreateTimerQueue

関数
タイマーキューを作成する。
DLLKERNEL32.dll呼出規約winapiSetLastErrorあり対応OSWindows XP 以降

シグネチャ

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

HANDLE CreateTimerQueue(void);

パラメーターなし。戻り値: HANDLE

各言語での呼び出し定義

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

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

CreateTimerQueue = ctypes.windll.kernel32.CreateTimerQueue
CreateTimerQueue.restype = ctypes.c_void_p
CreateTimerQueue.argtypes = []
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

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

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procCreateTimerQueue = kernel32.NewProc("CreateTimerQueue")
)

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