Win32 API 日本語リファレンス
ホームDevices.DeviceAndDriverInstallation › SetupGetNonInteractiveMode

SetupGetNonInteractiveMode

関数
セットアップが非対話モードかどうかを取得する。
DLLSETUPAPI.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

BOOL SetupGetNonInteractiveMode(void);

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

各言語での呼び出し定義

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

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

SetupGetNonInteractiveMode = ctypes.windll.setupapi.SetupGetNonInteractiveMode
SetupGetNonInteractiveMode.restype = wintypes.BOOL
SetupGetNonInteractiveMode.argtypes = []
require 'fiddle'
require 'fiddle/import'

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

var (
	setupapi = windows.NewLazySystemDLL("SETUPAPI.dll")
	procSetupGetNonInteractiveMode = setupapi.NewProc("SetupGetNonInteractiveMode")
)

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