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

UnregisterApplicationRestart

関数
アプリの自動再起動の登録を解除する。
DLLKERNEL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT UnregisterApplicationRestart(void);

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

各言語での呼び出し定義

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

HRESULT UnregisterApplicationRestart(void);
[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern int UnregisterApplicationRestart();
<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function UnregisterApplicationRestart() As Integer
End Function
Declare PtrSafe Function UnregisterApplicationRestart Lib "kernel32" () As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

UnregisterApplicationRestart = ctypes.windll.kernel32.UnregisterApplicationRestart
UnregisterApplicationRestart.restype = ctypes.c_int
UnregisterApplicationRestart.argtypes = []
require 'fiddle'
require 'fiddle/import'

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

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procUnregisterApplicationRestart = kernel32.NewProc("UnregisterApplicationRestart")
)

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