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

EnableThemeDialogTexture

関数
ダイアログのテーマテクスチャ(背景模様)を有効または無効にする。
DLLUxTheme.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT EnableThemeDialogTexture(
    HWND hwnd,
    DWORD dwFlags
);

パラメーター

名前方向
hwndHWNDin
dwFlagsDWORDin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT EnableThemeDialogTexture(
    HWND hwnd,
    DWORD dwFlags
);
[DllImport("UxTheme.dll", ExactSpelling = true)]
static extern int EnableThemeDialogTexture(
    IntPtr hwnd,   // HWND
    uint dwFlags   // DWORD
);
<DllImport("UxTheme.dll", ExactSpelling:=True)>
Public Shared Function EnableThemeDialogTexture(
    hwnd As IntPtr,   ' HWND
    dwFlags As UInteger   ' DWORD
) As Integer
End Function
' hwnd : HWND
' dwFlags : DWORD
Declare PtrSafe Function EnableThemeDialogTexture Lib "uxtheme" ( _
    ByVal hwnd As LongPtr, _
    ByVal dwFlags As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

EnableThemeDialogTexture = ctypes.windll.uxtheme.EnableThemeDialogTexture
EnableThemeDialogTexture.restype = ctypes.c_int
EnableThemeDialogTexture.argtypes = [
    wintypes.HANDLE,  # hwnd : HWND
    wintypes.DWORD,  # dwFlags : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('UxTheme.dll')
EnableThemeDialogTexture = Fiddle::Function.new(
  lib['EnableThemeDialogTexture'],
  [
    Fiddle::TYPE_VOIDP,  # hwnd : HWND
    -Fiddle::TYPE_INT,  # dwFlags : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "uxtheme")]
extern "system" {
    fn EnableThemeDialogTexture(
        hwnd: *mut core::ffi::c_void,  // HWND
        dwFlags: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("UxTheme.dll")]
public static extern int EnableThemeDialogTexture(IntPtr hwnd, uint dwFlags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'UxTheme_EnableThemeDialogTexture' -Namespace Win32 -PassThru
# $api::EnableThemeDialogTexture(hwnd, dwFlags)
#uselib "UxTheme.dll"
#func global EnableThemeDialogTexture "EnableThemeDialogTexture" sptr, sptr
; EnableThemeDialogTexture hwnd, dwFlags   ; 戻り値は stat
; hwnd : HWND -> "sptr"
; dwFlags : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "UxTheme.dll"
#cfunc global EnableThemeDialogTexture "EnableThemeDialogTexture" sptr, int
; res = EnableThemeDialogTexture(hwnd, dwFlags)
; hwnd : HWND -> "sptr"
; dwFlags : DWORD -> "int"
; HRESULT EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
#uselib "UxTheme.dll"
#cfunc global EnableThemeDialogTexture "EnableThemeDialogTexture" intptr, int
; res = EnableThemeDialogTexture(hwnd, dwFlags)
; hwnd : HWND -> "intptr"
; dwFlags : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	uxtheme = windows.NewLazySystemDLL("UxTheme.dll")
	procEnableThemeDialogTexture = uxtheme.NewProc("EnableThemeDialogTexture")
)

// hwnd (HWND), dwFlags (DWORD)
r1, _, err := procEnableThemeDialogTexture.Call(
	uintptr(hwnd),
	uintptr(dwFlags),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function EnableThemeDialogTexture(
  hwnd: THandle;   // HWND
  dwFlags: DWORD   // DWORD
): Integer; stdcall;
  external 'UxTheme.dll' name 'EnableThemeDialogTexture';
result := DllCall("UxTheme\EnableThemeDialogTexture"
    , "Ptr", hwnd   ; HWND
    , "UInt", dwFlags   ; DWORD
    , "Int")   ; return: HRESULT
●EnableThemeDialogTexture(hwnd, dwFlags) = DLL("UxTheme.dll", "int EnableThemeDialogTexture(void*, dword)")
# 呼び出し: EnableThemeDialogTexture(hwnd, dwFlags)
# hwnd : HWND -> "void*"
# dwFlags : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。