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

RtwqSetLongRunning

関数
作業キューを長時間実行モードに設定する。
DLLRTWorkQ.dll呼出規約winapi対応OSWindows 8.1 以降

シグネチャ

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

HRESULT RtwqSetLongRunning(
    DWORD workQueueId,
    BOOL enable
);

パラメーター

名前方向
workQueueIdDWORDin
enableBOOLin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT RtwqSetLongRunning(
    DWORD workQueueId,
    BOOL enable
);
[DllImport("RTWorkQ.dll", ExactSpelling = true)]
static extern int RtwqSetLongRunning(
    uint workQueueId,   // DWORD
    bool enable   // BOOL
);
<DllImport("RTWorkQ.dll", ExactSpelling:=True)>
Public Shared Function RtwqSetLongRunning(
    workQueueId As UInteger,   ' DWORD
    enable As Boolean   ' BOOL
) As Integer
End Function
' workQueueId : DWORD
' enable : BOOL
Declare PtrSafe Function RtwqSetLongRunning Lib "rtworkq" ( _
    ByVal workQueueId As Long, _
    ByVal enable As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RtwqSetLongRunning = ctypes.windll.rtworkq.RtwqSetLongRunning
RtwqSetLongRunning.restype = ctypes.c_int
RtwqSetLongRunning.argtypes = [
    wintypes.DWORD,  # workQueueId : DWORD
    wintypes.BOOL,  # enable : BOOL
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rtworkq = windows.NewLazySystemDLL("RTWorkQ.dll")
	procRtwqSetLongRunning = rtworkq.NewProc("RtwqSetLongRunning")
)

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