JsIdle
関数アイドル処理を実行し次回アイドル時刻を取得する。
シグネチャ
// chakra.dll
#include <windows.h>
JsErrorCode JsIdle(
DWORD* nextIdleTick // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| nextIdleTick | DWORD* | outoptional |
戻り値の型: JsErrorCode
各言語での呼び出し定義
// chakra.dll
#include <windows.h>
JsErrorCode JsIdle(
DWORD* nextIdleTick // optional
);[DllImport("chakra.dll", ExactSpelling = true)]
static extern uint JsIdle(
IntPtr nextIdleTick // DWORD* optional, out
);<DllImport("chakra.dll", ExactSpelling:=True)>
Public Shared Function JsIdle(
nextIdleTick As IntPtr ' DWORD* optional, out
) As UInteger
End Function' nextIdleTick : DWORD* optional, out
Declare PtrSafe Function JsIdle Lib "chakra" ( _
ByVal nextIdleTick As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
JsIdle = ctypes.windll.chakra.JsIdle
JsIdle.restype = wintypes.DWORD
JsIdle.argtypes = [
ctypes.POINTER(wintypes.DWORD), # nextIdleTick : DWORD* optional, out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('chakra.dll')
JsIdle = Fiddle::Function.new(
lib['JsIdle'],
[
Fiddle::TYPE_VOIDP, # nextIdleTick : DWORD* optional, out
],
-Fiddle::TYPE_INT)#[link(name = "chakra")]
extern "system" {
fn JsIdle(
nextIdleTick: *mut u32 // DWORD* optional, out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("chakra.dll")]
public static extern uint JsIdle(IntPtr nextIdleTick);
"@
$api = Add-Type -MemberDefinition $sig -Name 'chakra_JsIdle' -Namespace Win32 -PassThru
# $api::JsIdle(nextIdleTick)#uselib "chakra.dll"
#func global JsIdle "JsIdle" sptr
; JsIdle varptr(nextIdleTick) ; 戻り値は stat
; nextIdleTick : DWORD* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "chakra.dll" #cfunc global JsIdle "JsIdle" var ; res = JsIdle(nextIdleTick) ; nextIdleTick : DWORD* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "chakra.dll" #cfunc global JsIdle "JsIdle" sptr ; res = JsIdle(varptr(nextIdleTick)) ; nextIdleTick : DWORD* optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; JsErrorCode JsIdle(DWORD* nextIdleTick) #uselib "chakra.dll" #cfunc global JsIdle "JsIdle" var ; res = JsIdle(nextIdleTick) ; nextIdleTick : DWORD* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; JsErrorCode JsIdle(DWORD* nextIdleTick) #uselib "chakra.dll" #cfunc global JsIdle "JsIdle" intptr ; res = JsIdle(varptr(nextIdleTick)) ; nextIdleTick : DWORD* optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
chakra = windows.NewLazySystemDLL("chakra.dll")
procJsIdle = chakra.NewProc("JsIdle")
)
// nextIdleTick (DWORD* optional, out)
r1, _, err := procJsIdle.Call(
uintptr(nextIdleTick),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // JsErrorCodefunction JsIdle(
nextIdleTick: Pointer // DWORD* optional, out
): DWORD; stdcall;
external 'chakra.dll' name 'JsIdle';result := DllCall("chakra\JsIdle"
, "Ptr", nextIdleTick ; DWORD* optional, out
, "UInt") ; return: JsErrorCode●JsIdle(nextIdleTick) = DLL("chakra.dll", "dword JsIdle(void*)")
# 呼び出し: JsIdle(nextIdleTick)
# nextIdleTick : DWORD* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。