Funktionreferenz


_WinAPI_SetWindowTheme


Causes a window to use a different set of visual style information than its class normally uses

#include <WinAPITheme.au3>
_WinAPI_SetWindowTheme ( $hWnd [, $sName = Default [, $sList = Default]] )

Parameter

$hWnd Handle to the window whose visual style information is to be changed.
$sName [optional] A string that contains the application name. If this parameter is 0 (Default), the calling application's name is used.
$sList [optional] A string that contains a semicolon-separated list of CLSID names to use in place of the actual list
passed by the window's class. If this parameter is 0 (Default), the ID list from the calling class is used.

Rückgabewert

Success: 1.
Failure: 0 and sets the @error flag to non-zero, @extended flag may contain the HRESULT error code.

Bemerkungen

The theme manager retains the $sName and the $sList associations through the lifetime of the window, even
if visual styles subsequently change.

When $sName and $sList are Default, the theme manager removes the previously applied associations.
To prevent visual styles from being applied to a specified window, add a _WinAPI_SetWindowTheme($hWnd, "", "") which will not match any section entries.

Siehe auch

Suche nach SetWindowTheme in der MSDN Bibliothek.

Beispiel

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WinAPISys.au3>
#include <WinAPITheme.au3>

If Number(_WinAPI_GetVersion()) < 6.0 Then
    MsgBox(($MB_ICONERROR + $MB_SYSTEMMODAL), 'Fehler', 'Benötigt Windows Vista oder neuer.')
    Exit
EndIf

GUICreate('Test ' & StringReplace(@ScriptName, '.au3', '()'), 332, 400)

Local $idListview = GUICtrlCreateListView('Spalte 1|Spalte 2|Spalte 3|Spalte 4', 10, 10, 312, 380)
For $i = 1 To 9
    GUICtrlCreateListViewItem('Item ' & $i & '|' & 'Sub ' & $i & '|' & 'Sub ' & $i & '|' & 'Sub ' & $i, $idListview)
Next

_WinAPI_SetWindowTheme(GUICtrlGetHandle($idListview), 'Explorer')

GUISetState(@SW_SHOW)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE