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

IsThemeActive

関数
現在ビジュアルスタイルのテーマが有効かどうかを判定する。
DLLUXTHEME.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// UXTHEME.dll
#include <windows.h>

BOOL IsThemeActive(void);

パラメーターなし。戻り値: BOOL

各言語での呼び出し定義

// UXTHEME.dll
#include <windows.h>

BOOL IsThemeActive(void);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("UXTHEME.dll", ExactSpelling = true)]
static extern bool IsThemeActive();
<DllImport("UXTHEME.dll", ExactSpelling:=True)>
Public Shared Function IsThemeActive() As Boolean
End Function
Declare PtrSafe Function IsThemeActive Lib "uxtheme" () As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

IsThemeActive = ctypes.windll.uxtheme.IsThemeActive
IsThemeActive.restype = wintypes.BOOL
IsThemeActive.argtypes = []
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('UXTHEME.dll')
IsThemeActive = Fiddle::Function.new(
  lib['IsThemeActive'],
  [],
  Fiddle::TYPE_INT)
#[link(name = "uxtheme")]
extern "system" {
    fn IsThemeActive() -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("UXTHEME.dll")]
public static extern bool IsThemeActive();
"@
$api = Add-Type -MemberDefinition $sig -Name 'UXTHEME_IsThemeActive' -Namespace Win32 -PassThru
# $api::IsThemeActive()
#uselib "UXTHEME.dll"
#func global IsThemeActive "IsThemeActive"
; IsThemeActive   ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "UXTHEME.dll"
#cfunc global IsThemeActive "IsThemeActive"
; res = IsThemeActive()
; BOOL IsThemeActive()
#uselib "UXTHEME.dll"
#cfunc global IsThemeActive "IsThemeActive"
; res = IsThemeActive()
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	uxtheme = windows.NewLazySystemDLL("UXTHEME.dll")
	procIsThemeActive = uxtheme.NewProc("IsThemeActive")
)

r1, _, err := procIsThemeActive.Call()
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function IsThemeActive: BOOL; stdcall;
  external 'UXTHEME.dll' name 'IsThemeActive';
result := DllCall("UXTHEME\IsThemeActive", "Int")
●IsThemeActive() = DLL("UXTHEME.dll", "bool IsThemeActive()")
# 呼び出し: IsThemeActive()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。