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

SetupSetNonInteractiveMode

関数
セットアップの非対話モードの有効無効を設定する。
DLLSETUPAPI.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

BOOL SetupSetNonInteractiveMode(
    BOOL NonInteractiveFlag
);

パラメーター

名前方向
NonInteractiveFlagBOOLin

戻り値の型: BOOL

各言語での呼び出し定義

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

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

SetupSetNonInteractiveMode = ctypes.windll.setupapi.SetupSetNonInteractiveMode
SetupSetNonInteractiveMode.restype = wintypes.BOOL
SetupSetNonInteractiveMode.argtypes = [
    wintypes.BOOL,  # NonInteractiveFlag : BOOL
]
require 'fiddle'
require 'fiddle/import'

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

var (
	setupapi = windows.NewLazySystemDLL("SETUPAPI.dll")
	procSetupSetNonInteractiveMode = setupapi.NewProc("SetupSetNonInteractiveMode")
)

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