ホーム › System.Power › PowerUnregisterFromEffectivePowerModeNotifications
PowerUnregisterFromEffectivePowerModeNotifications
関数実効電源モード通知の登録を解除する。
シグネチャ
// POWRPROF.dll
#include <windows.h>
HRESULT PowerUnregisterFromEffectivePowerModeNotifications(
void* RegistrationHandle
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| RegistrationHandle | void* | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// POWRPROF.dll
#include <windows.h>
HRESULT PowerUnregisterFromEffectivePowerModeNotifications(
void* RegistrationHandle
);[DllImport("POWRPROF.dll", ExactSpelling = true)]
static extern int PowerUnregisterFromEffectivePowerModeNotifications(
IntPtr RegistrationHandle // void*
);<DllImport("POWRPROF.dll", ExactSpelling:=True)>
Public Shared Function PowerUnregisterFromEffectivePowerModeNotifications(
RegistrationHandle As IntPtr ' void*
) As Integer
End Function' RegistrationHandle : void*
Declare PtrSafe Function PowerUnregisterFromEffectivePowerModeNotifications Lib "powrprof" ( _
ByVal RegistrationHandle As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
PowerUnregisterFromEffectivePowerModeNotifications = ctypes.windll.powrprof.PowerUnregisterFromEffectivePowerModeNotifications
PowerUnregisterFromEffectivePowerModeNotifications.restype = ctypes.c_int
PowerUnregisterFromEffectivePowerModeNotifications.argtypes = [
ctypes.POINTER(None), # RegistrationHandle : void*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('POWRPROF.dll')
PowerUnregisterFromEffectivePowerModeNotifications = Fiddle::Function.new(
lib['PowerUnregisterFromEffectivePowerModeNotifications'],
[
Fiddle::TYPE_VOIDP, # RegistrationHandle : void*
],
Fiddle::TYPE_INT)#[link(name = "powrprof")]
extern "system" {
fn PowerUnregisterFromEffectivePowerModeNotifications(
RegistrationHandle: *mut () // void*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("POWRPROF.dll")]
public static extern int PowerUnregisterFromEffectivePowerModeNotifications(IntPtr RegistrationHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'POWRPROF_PowerUnregisterFromEffectivePowerModeNotifications' -Namespace Win32 -PassThru
# $api::PowerUnregisterFromEffectivePowerModeNotifications(RegistrationHandle)#uselib "POWRPROF.dll"
#func global PowerUnregisterFromEffectivePowerModeNotifications "PowerUnregisterFromEffectivePowerModeNotifications" sptr
; PowerUnregisterFromEffectivePowerModeNotifications RegistrationHandle ; 戻り値は stat
; RegistrationHandle : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "POWRPROF.dll"
#cfunc global PowerUnregisterFromEffectivePowerModeNotifications "PowerUnregisterFromEffectivePowerModeNotifications" sptr
; res = PowerUnregisterFromEffectivePowerModeNotifications(RegistrationHandle)
; RegistrationHandle : void* -> "sptr"; HRESULT PowerUnregisterFromEffectivePowerModeNotifications(void* RegistrationHandle)
#uselib "POWRPROF.dll"
#cfunc global PowerUnregisterFromEffectivePowerModeNotifications "PowerUnregisterFromEffectivePowerModeNotifications" intptr
; res = PowerUnregisterFromEffectivePowerModeNotifications(RegistrationHandle)
; RegistrationHandle : void* -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
powrprof = windows.NewLazySystemDLL("POWRPROF.dll")
procPowerUnregisterFromEffectivePowerModeNotifications = powrprof.NewProc("PowerUnregisterFromEffectivePowerModeNotifications")
)
// RegistrationHandle (void*)
r1, _, err := procPowerUnregisterFromEffectivePowerModeNotifications.Call(
uintptr(RegistrationHandle),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction PowerUnregisterFromEffectivePowerModeNotifications(
RegistrationHandle: Pointer // void*
): Integer; stdcall;
external 'POWRPROF.dll' name 'PowerUnregisterFromEffectivePowerModeNotifications';result := DllCall("POWRPROF\PowerUnregisterFromEffectivePowerModeNotifications"
, "Ptr", RegistrationHandle ; void*
, "Int") ; return: HRESULT●PowerUnregisterFromEffectivePowerModeNotifications(RegistrationHandle) = DLL("POWRPROF.dll", "int PowerUnregisterFromEffectivePowerModeNotifications(void*)")
# 呼び出し: PowerUnregisterFromEffectivePowerModeNotifications(RegistrationHandle)
# RegistrationHandle : void* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。