Table of Contents

Method SetWindowTheme

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

SetWindowTheme(nint, string, string)

Sets the visual style of a window by applying a theme from the current theme data.

public static extern int SetWindowTheme(nint hWnd, string pszSubAppName, string pszSubIdList)

Parameters

hWnd nint

A handle to the window whose visual style is to be changed.

pszSubAppName string

The application name to associate with the window. Pass null to remove any existing association.

pszSubIdList string

The sub-identifier list to associate with the window. Pass null to remove any existing association.

Returns

int

Returns 0 if the operation succeeds; otherwise, returns a nonzero error code. For more information about error codes, see the Windows API documentation.

Remarks

This method is a wrapper for the native SetWindowTheme function in the uxtheme.dll library. It allows you to customize the appearance of a window by associating it with a specific theme.