Function IsThemeActive() Foundation

Tests whether visual Styles are enabled.

Syntax
IsThemeActive( [<lCheckApp>] [,<nAppStyles>]) --> lActive
Parameters
<lCheckApp>
<lCheckApp> is a logical value that specifies the operating mode for IsThemeActive(). The parameter is optional. Its default value is .T. (TRUE).
<nAppStyles>
<nAppStyles> is a numeric value that specifies the required visual styles which must be accessible to the application. This parameter is optional and defaults to the value corresponding to the contants XBPAPP_DIALOGSTYLES + XBPAPP_CHILDSTYLES. See XbpApplication:enableVisualStylesfor further information.

This parameter only has an effect for GUI and PM-mode applications. In addition, .T. must be passed for the <lCheckApp> parameter.

Return

This function returns a logical value that indicates whether visual styles are enabled or not. The specific meaning of the return value depends on the setting in parameter <lCheckApp>:

If the value .F. (false) is passed in <lCheckApp>, IsThemeActive() checks if visual styles are generally available on the current platform. In this mode, IsThemeActive() returns .T. (true) if styles are supported by the operating system and are currently enabled in Control Panel. Otherwise, the function returns .F..

If .T. is passed in parameter <lCheckApp>, IsThemeActive() also verifies if the Xbase++ application is run in themed mode. In this mode, the function only returns .T. if the following conditions are met:

The operating system supports visual styles
Visual styles are enabled in Control Panel
The Xbase++ application is not run in compatibility mode with visual styles disabled
A manifest has been defined for the Xbase++ application. See the examples in folder ..\SOURCE\SAMPLES\BASICS\MANIFEST for further information on manifests.
The visual styles available to the application match the requirements specified in parameter <nAppStyles>.
Description

The environment function IsThemeActive() checks whether visual styles are currently enabled for the application. Furthermore, the function can be used to determine whether the operating system generally supports visual styles. If visual styles are enabled, user interface elements are displayed using special designs that can selected via Control Panel. For example, push button or group box objects are drawn with rounded borders when styles are enabled. IsThemeActive() is generally used by Xbase++ applications that implement custom drawing for their user interface elements.

Visual styles are sometimes referred to as visual themes in operating system dialogs and the documentation, hence the name of the function. They have been introduced with Windows XP and are not available on older platforms.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.