Win32 API 日本語リファレンス
ホームGaming › HasExpandedResources

HasExpandedResources

関数
アプリが拡張リソースモードかどうかを判定する。
DLLapi-ms-win-gaming-expandedresources-l1-1-0.dll呼出規約winapi

シグネチャ

// api-ms-win-gaming-expandedresources-l1-1-0.dll
#include <windows.h>

HRESULT HasExpandedResources(
    BOOL* hasExpandedResources
);

パラメーター

名前方向
hasExpandedResourcesBOOL*out

戻り値の型: HRESULT

各言語での呼び出し定義

// api-ms-win-gaming-expandedresources-l1-1-0.dll
#include <windows.h>

HRESULT HasExpandedResources(
    BOOL* hasExpandedResources
);
[DllImport("api-ms-win-gaming-expandedresources-l1-1-0.dll", ExactSpelling = true)]
static extern int HasExpandedResources(
    out int hasExpandedResources   // BOOL* out
);
<DllImport("api-ms-win-gaming-expandedresources-l1-1-0.dll", ExactSpelling:=True)>
Public Shared Function HasExpandedResources(
    <Out> ByRef hasExpandedResources As Integer   ' BOOL* out
) As Integer
End Function
' hasExpandedResources : BOOL* out
Declare PtrSafe Function HasExpandedResources Lib "api-ms-win-gaming-expandedresources-l1-1-0" ( _
    ByRef hasExpandedResources As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

HasExpandedResources = ctypes.windll.LoadLibrary("api-ms-win-gaming-expandedresources-l1-1-0.dll").HasExpandedResources
HasExpandedResources.restype = ctypes.c_int
HasExpandedResources.argtypes = [
    ctypes.c_void_p,  # hasExpandedResources : BOOL* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	api_ms_win_gaming_expandedresources_l1_1_0 = windows.NewLazySystemDLL("api-ms-win-gaming-expandedresources-l1-1-0.dll")
	procHasExpandedResources = api_ms_win_gaming_expandedresources_l1_1_0.NewProc("HasExpandedResources")
)

// hasExpandedResources (BOOL* out)
r1, _, err := procHasExpandedResources.Call(
	uintptr(hasExpandedResources),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function HasExpandedResources(
  hasExpandedResources: Pointer   // BOOL* out
): Integer; stdcall;
  external 'api-ms-win-gaming-expandedresources-l1-1-0.dll' name 'HasExpandedResources';
result := DllCall("api-ms-win-gaming-expandedresources-l1-1-0\HasExpandedResources"
    , "Ptr", hasExpandedResources   ; BOOL* out
    , "Int")   ; return: HRESULT
●HasExpandedResources(hasExpandedResources) = DLL("api-ms-win-gaming-expandedresources-l1-1-0.dll", "int HasExpandedResources(void*)")
# 呼び出し: HasExpandedResources(hasExpandedResources)
# hasExpandedResources : BOOL* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。