ホーム › UI.Controls › GetThemeSysBool
GetThemeSysBool
関数テーマで定義されたシステム真偽値を取得する。
シグネチャ
// UxTheme.dll
#include <windows.h>
BOOL GetThemeSysBool(
HTHEME hTheme, // optional
INT iBoolId
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hTheme | HTHEME | inoptional |
| iBoolId | INT | in |
戻り値の型: BOOL
各言語での呼び出し定義
// UxTheme.dll
#include <windows.h>
BOOL GetThemeSysBool(
HTHEME hTheme, // optional
INT iBoolId
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("UxTheme.dll", ExactSpelling = true)]
static extern bool GetThemeSysBool(
IntPtr hTheme, // HTHEME optional
int iBoolId // INT
);<DllImport("UxTheme.dll", ExactSpelling:=True)>
Public Shared Function GetThemeSysBool(
hTheme As IntPtr, ' HTHEME optional
iBoolId As Integer ' INT
) As Boolean
End Function' hTheme : HTHEME optional
' iBoolId : INT
Declare PtrSafe Function GetThemeSysBool Lib "uxtheme" ( _
ByVal hTheme As LongPtr, _
ByVal iBoolId As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetThemeSysBool = ctypes.windll.uxtheme.GetThemeSysBool
GetThemeSysBool.restype = wintypes.BOOL
GetThemeSysBool.argtypes = [
ctypes.c_ssize_t, # hTheme : HTHEME optional
ctypes.c_int, # iBoolId : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('UxTheme.dll')
GetThemeSysBool = Fiddle::Function.new(
lib['GetThemeSysBool'],
[
Fiddle::TYPE_INTPTR_T, # hTheme : HTHEME optional
Fiddle::TYPE_INT, # iBoolId : INT
],
Fiddle::TYPE_INT)#[link(name = "uxtheme")]
extern "system" {
fn GetThemeSysBool(
hTheme: isize, // HTHEME optional
iBoolId: i32 // INT
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("UxTheme.dll")]
public static extern bool GetThemeSysBool(IntPtr hTheme, int iBoolId);
"@
$api = Add-Type -MemberDefinition $sig -Name 'UxTheme_GetThemeSysBool' -Namespace Win32 -PassThru
# $api::GetThemeSysBool(hTheme, iBoolId)#uselib "UxTheme.dll"
#func global GetThemeSysBool "GetThemeSysBool" sptr, sptr
; GetThemeSysBool hTheme, iBoolId ; 戻り値は stat
; hTheme : HTHEME optional -> "sptr"
; iBoolId : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "UxTheme.dll"
#cfunc global GetThemeSysBool "GetThemeSysBool" sptr, int
; res = GetThemeSysBool(hTheme, iBoolId)
; hTheme : HTHEME optional -> "sptr"
; iBoolId : INT -> "int"; BOOL GetThemeSysBool(HTHEME hTheme, INT iBoolId)
#uselib "UxTheme.dll"
#cfunc global GetThemeSysBool "GetThemeSysBool" intptr, int
; res = GetThemeSysBool(hTheme, iBoolId)
; hTheme : HTHEME optional -> "intptr"
; iBoolId : INT -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
uxtheme = windows.NewLazySystemDLL("UxTheme.dll")
procGetThemeSysBool = uxtheme.NewProc("GetThemeSysBool")
)
// hTheme (HTHEME optional), iBoolId (INT)
r1, _, err := procGetThemeSysBool.Call(
uintptr(hTheme),
uintptr(iBoolId),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction GetThemeSysBool(
hTheme: NativeInt; // HTHEME optional
iBoolId: Integer // INT
): BOOL; stdcall;
external 'UxTheme.dll' name 'GetThemeSysBool';result := DllCall("UxTheme\GetThemeSysBool"
, "Ptr", hTheme ; HTHEME optional
, "Int", iBoolId ; INT
, "Int") ; return: BOOL●GetThemeSysBool(hTheme, iBoolId) = DLL("UxTheme.dll", "bool GetThemeSysBool(int, int)")
# 呼び出し: GetThemeSysBool(hTheme, iBoolId)
# hTheme : HTHEME optional -> "int"
# iBoolId : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。