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