Win32 API 日本語リファレンス
ホームUI.Shell › UnregisterAppConstrainedChangeNotification

UnregisterAppConstrainedChangeNotification

関数
アプリ制約状態変更通知の登録を解除する。
DLLapi-ms-win-core-psm-appnotify-l1-1-1.dll呼出規約winapi

シグネチャ

// api-ms-win-core-psm-appnotify-l1-1-1.dll
#include <windows.h>

void UnregisterAppConstrainedChangeNotification(
    PAPPCONSTRAIN_REGISTRATION Registration
);

パラメーター

名前方向説明
RegistrationPAPPCONSTRAIN_REGISTRATIONin解除対象のアプリ制約状態変化通知の登録ハンドル。

戻り値の型: void

各言語での呼び出し定義

// api-ms-win-core-psm-appnotify-l1-1-1.dll
#include <windows.h>

void UnregisterAppConstrainedChangeNotification(
    PAPPCONSTRAIN_REGISTRATION Registration
);
[DllImport("api-ms-win-core-psm-appnotify-l1-1-1.dll", ExactSpelling = true)]
static extern void UnregisterAppConstrainedChangeNotification(
    IntPtr Registration   // PAPPCONSTRAIN_REGISTRATION
);
<DllImport("api-ms-win-core-psm-appnotify-l1-1-1.dll", ExactSpelling:=True)>
Public Shared Sub UnregisterAppConstrainedChangeNotification(
    Registration As IntPtr   ' PAPPCONSTRAIN_REGISTRATION
)
End Sub
' Registration : PAPPCONSTRAIN_REGISTRATION
Declare PtrSafe Sub UnregisterAppConstrainedChangeNotification Lib "api-ms-win-core-psm-appnotify-l1-1-1" ( _
    ByVal Registration As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

UnregisterAppConstrainedChangeNotification = ctypes.windll.LoadLibrary("api-ms-win-core-psm-appnotify-l1-1-1.dll").UnregisterAppConstrainedChangeNotification
UnregisterAppConstrainedChangeNotification.restype = None
UnregisterAppConstrainedChangeNotification.argtypes = [
    ctypes.c_ssize_t,  # Registration : PAPPCONSTRAIN_REGISTRATION
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('api-ms-win-core-psm-appnotify-l1-1-1.dll')
UnregisterAppConstrainedChangeNotification = Fiddle::Function.new(
  lib['UnregisterAppConstrainedChangeNotification'],
  [
    Fiddle::TYPE_INTPTR_T,  # Registration : PAPPCONSTRAIN_REGISTRATION
  ],
  Fiddle::TYPE_VOID)
#[link(name = "api-ms-win-core-psm-appnotify-l1-1-1")]
extern "system" {
    fn UnregisterAppConstrainedChangeNotification(
        Registration: isize  // PAPPCONSTRAIN_REGISTRATION
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("api-ms-win-core-psm-appnotify-l1-1-1.dll")]
public static extern void UnregisterAppConstrainedChangeNotification(IntPtr Registration);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-core-psm-appnotify-l1-1-1_UnregisterAppConstrainedChangeNotification' -Namespace Win32 -PassThru
# $api::UnregisterAppConstrainedChangeNotification(Registration)
#uselib "api-ms-win-core-psm-appnotify-l1-1-1.dll"
#func global UnregisterAppConstrainedChangeNotification "UnregisterAppConstrainedChangeNotification" sptr
; UnregisterAppConstrainedChangeNotification Registration
; Registration : PAPPCONSTRAIN_REGISTRATION -> "sptr"
#uselib "api-ms-win-core-psm-appnotify-l1-1-1.dll"
#func global UnregisterAppConstrainedChangeNotification "UnregisterAppConstrainedChangeNotification" sptr
; UnregisterAppConstrainedChangeNotification Registration
; Registration : PAPPCONSTRAIN_REGISTRATION -> "sptr"
; void UnregisterAppConstrainedChangeNotification(PAPPCONSTRAIN_REGISTRATION Registration)
#uselib "api-ms-win-core-psm-appnotify-l1-1-1.dll"
#func global UnregisterAppConstrainedChangeNotification "UnregisterAppConstrainedChangeNotification" intptr
; UnregisterAppConstrainedChangeNotification Registration
; Registration : PAPPCONSTRAIN_REGISTRATION -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	api_ms_win_core_psm_appnotify_l1_1_1 = windows.NewLazySystemDLL("api-ms-win-core-psm-appnotify-l1-1-1.dll")
	procUnregisterAppConstrainedChangeNotification = api_ms_win_core_psm_appnotify_l1_1_1.NewProc("UnregisterAppConstrainedChangeNotification")
)

// Registration (PAPPCONSTRAIN_REGISTRATION)
r1, _, err := procUnregisterAppConstrainedChangeNotification.Call(
	uintptr(Registration),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure UnregisterAppConstrainedChangeNotification(
  Registration: NativeInt   // PAPPCONSTRAIN_REGISTRATION
); stdcall;
  external 'api-ms-win-core-psm-appnotify-l1-1-1.dll' name 'UnregisterAppConstrainedChangeNotification';
result := DllCall("api-ms-win-core-psm-appnotify-l1-1-1\UnregisterAppConstrainedChangeNotification"
    , "Ptr", Registration   ; PAPPCONSTRAIN_REGISTRATION
    , "Int")   ; return: void
●UnregisterAppConstrainedChangeNotification(Registration) = DLL("api-ms-win-core-psm-appnotify-l1-1-1.dll", "int UnregisterAppConstrainedChangeNotification(int)")
# 呼び出し: UnregisterAppConstrainedChangeNotification(Registration)
# Registration : PAPPCONSTRAIN_REGISTRATION -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "api-ms-win-core-psm-appnotify-l1-1-1" fn UnregisterAppConstrainedChangeNotification(
    Registration: isize // PAPPCONSTRAIN_REGISTRATION
) callconv(std.os.windows.WINAPI) void;
proc UnregisterAppConstrainedChangeNotification(
    Registration: int  # PAPPCONSTRAIN_REGISTRATION
) {.importc: "UnregisterAppConstrainedChangeNotification", stdcall, dynlib: "api-ms-win-core-psm-appnotify-l1-1-1.dll".}
pragma(lib, "api-ms-win-core-psm-appnotify-l1-1-1");
extern(Windows)
void UnregisterAppConstrainedChangeNotification(
    ptrdiff_t Registration   // PAPPCONSTRAIN_REGISTRATION
);
ccall((:UnregisterAppConstrainedChangeNotification, "api-ms-win-core-psm-appnotify-l1-1-1.dll"), stdcall, Cvoid,
      (Int,),
      Registration)
# Registration : PAPPCONSTRAIN_REGISTRATION -> Int
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
void UnregisterAppConstrainedChangeNotification(
    intptr_t Registration);
]]
local api-ms-win-core-psm-appnotify-l1-1-1 = ffi.load("api-ms-win-core-psm-appnotify-l1-1-1")
-- api-ms-win-core-psm-appnotify-l1-1-1.UnregisterAppConstrainedChangeNotification(Registration)
-- Registration : PAPPCONSTRAIN_REGISTRATION
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('api-ms-win-core-psm-appnotify-l1-1-1.dll');
const UnregisterAppConstrainedChangeNotification = lib.func('__stdcall', 'UnregisterAppConstrainedChangeNotification', 'void', ['intptr_t']);
// UnregisterAppConstrainedChangeNotification(Registration)
// Registration : PAPPCONSTRAIN_REGISTRATION -> 'intptr_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("api-ms-win-core-psm-appnotify-l1-1-1.dll", {
  UnregisterAppConstrainedChangeNotification: { parameters: ["isize"], result: "void" },
});
// lib.symbols.UnregisterAppConstrainedChangeNotification(Registration)
// Registration : PAPPCONSTRAIN_REGISTRATION -> "isize"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void UnregisterAppConstrainedChangeNotification(
    intptr_t Registration);
C, "api-ms-win-core-psm-appnotify-l1-1-1.dll");
// $ffi->UnregisterAppConstrainedChangeNotification(Registration);
// Registration : PAPPCONSTRAIN_REGISTRATION
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Api-ms-win-core-psm-appnotify-l1-1-1 extends StdCallLibrary {
    Api-ms-win-core-psm-appnotify-l1-1-1 INSTANCE = Native.load("api-ms-win-core-psm-appnotify-l1-1-1", Api-ms-win-core-psm-appnotify-l1-1-1.class);
    void UnregisterAppConstrainedChangeNotification(
        long Registration   // PAPPCONSTRAIN_REGISTRATION
    );
}
@[Link("api-ms-win-core-psm-appnotify-l1-1-1")]
lib Libapi-ms-win-core-psm-appnotify-l1-1-1
  fun UnregisterAppConstrainedChangeNotification = UnregisterAppConstrainedChangeNotification(
    Registration : LibC::SSizeT   # PAPPCONSTRAIN_REGISTRATION
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef UnregisterAppConstrainedChangeNotificationNative = Void Function(IntPtr);
typedef UnregisterAppConstrainedChangeNotificationDart = void Function(int);
final UnregisterAppConstrainedChangeNotification = DynamicLibrary.open('api-ms-win-core-psm-appnotify-l1-1-1.dll')
    .lookupFunction<UnregisterAppConstrainedChangeNotificationNative, UnregisterAppConstrainedChangeNotificationDart>('UnregisterAppConstrainedChangeNotification');
// Registration : PAPPCONSTRAIN_REGISTRATION -> IntPtr
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure UnregisterAppConstrainedChangeNotification(
  Registration: NativeInt   // PAPPCONSTRAIN_REGISTRATION
); stdcall;
  external 'api-ms-win-core-psm-appnotify-l1-1-1.dll' name 'UnregisterAppConstrainedChangeNotification';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "UnregisterAppConstrainedChangeNotification"
  c_UnregisterAppConstrainedChangeNotification :: CIntPtr -> IO ()
-- Registration : PAPPCONSTRAIN_REGISTRATION -> CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let unregisterappconstrainedchangenotification =
  foreign "UnregisterAppConstrainedChangeNotification"
    (intptr_t @-> returning void)
(* Registration : PAPPCONSTRAIN_REGISTRATION -> intptr_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library api-ms-win-core-psm-appnotify-l1-1-1 (t "api-ms-win-core-psm-appnotify-l1-1-1.dll"))
(cffi:use-foreign-library api-ms-win-core-psm-appnotify-l1-1-1)

(cffi:defcfun ("UnregisterAppConstrainedChangeNotification" unregister-app-constrained-change-notification :convention :stdcall) :void
  (registration :int64))   ; PAPPCONSTRAIN_REGISTRATION
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $UnregisterAppConstrainedChangeNotification = Win32::API::More->new('api-ms-win-core-psm-appnotify-l1-1-1',
    'void UnregisterAppConstrainedChangeNotification(LPARAM Registration)');
# my $ret = $UnregisterAppConstrainedChangeNotification->Call($Registration);
# Registration : PAPPCONSTRAIN_REGISTRATION -> LPARAM
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。