SHRestricted
関数シェルの管理ポリシーによる制限状態を取得する。
シグネチャ
// SHELL32.dll
#include <windows.h>
DWORD SHRestricted(
RESTRICTIONS rest
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| rest | RESTRICTIONS | in |
戻り値の型: DWORD
各言語での呼び出し定義
// SHELL32.dll
#include <windows.h>
DWORD SHRestricted(
RESTRICTIONS rest
);[DllImport("SHELL32.dll", ExactSpelling = true)]
static extern uint SHRestricted(
int rest // RESTRICTIONS
);<DllImport("SHELL32.dll", ExactSpelling:=True)>
Public Shared Function SHRestricted(
rest As Integer ' RESTRICTIONS
) As UInteger
End Function' rest : RESTRICTIONS
Declare PtrSafe Function SHRestricted Lib "shell32" ( _
ByVal rest As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SHRestricted = ctypes.windll.shell32.SHRestricted
SHRestricted.restype = wintypes.DWORD
SHRestricted.argtypes = [
ctypes.c_int, # rest : RESTRICTIONS
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SHELL32.dll')
SHRestricted = Fiddle::Function.new(
lib['SHRestricted'],
[
Fiddle::TYPE_INT, # rest : RESTRICTIONS
],
-Fiddle::TYPE_INT)#[link(name = "shell32")]
extern "system" {
fn SHRestricted(
rest: i32 // RESTRICTIONS
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SHELL32.dll")]
public static extern uint SHRestricted(int rest);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_SHRestricted' -Namespace Win32 -PassThru
# $api::SHRestricted(rest)#uselib "SHELL32.dll"
#func global SHRestricted "SHRestricted" sptr
; SHRestricted rest ; 戻り値は stat
; rest : RESTRICTIONS -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "SHELL32.dll"
#cfunc global SHRestricted "SHRestricted" int
; res = SHRestricted(rest)
; rest : RESTRICTIONS -> "int"; DWORD SHRestricted(RESTRICTIONS rest)
#uselib "SHELL32.dll"
#cfunc global SHRestricted "SHRestricted" int
; res = SHRestricted(rest)
; rest : RESTRICTIONS -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
shell32 = windows.NewLazySystemDLL("SHELL32.dll")
procSHRestricted = shell32.NewProc("SHRestricted")
)
// rest (RESTRICTIONS)
r1, _, err := procSHRestricted.Call(
uintptr(rest),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction SHRestricted(
rest: Integer // RESTRICTIONS
): DWORD; stdcall;
external 'SHELL32.dll' name 'SHRestricted';result := DllCall("SHELL32\SHRestricted"
, "Int", rest ; RESTRICTIONS
, "UInt") ; return: DWORD●SHRestricted(rest) = DLL("SHELL32.dll", "dword SHRestricted(int)")
# 呼び出し: SHRestricted(rest)
# rest : RESTRICTIONS -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。