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

IsThreadpoolTimerSet

関数
スレッドプールタイマーが設定済みか判定する。
DLLKERNEL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

BOOL IsThreadpoolTimerSet(
    PTP_TIMER pti
);

パラメーター

名前方向
ptiPTP_TIMERin

戻り値の型: BOOL

各言語での呼び出し定義

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

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

IsThreadpoolTimerSet = ctypes.windll.kernel32.IsThreadpoolTimerSet
IsThreadpoolTimerSet.restype = wintypes.BOOL
IsThreadpoolTimerSet.argtypes = [
    ctypes.c_ssize_t,  # pti : PTP_TIMER
]
require 'fiddle'
require 'fiddle/import'

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

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procIsThreadpoolTimerSet = kernel32.NewProc("IsThreadpoolTimerSet")
)

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