Method SetWindowTheme
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
hWndnintA handle to the window whose visual style is to be changed.
pszSubAppNamestringThe application name to associate with the window. Pass null to remove any existing association.
pszSubIdListstringThe 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.