Older Newer
Fri, 03 Sep 2021 04:18:02 . . . . SyneRyder [Add link to setDialogTheme and note about hosts running in compatibility mode]


Changes by last author:

Added:
= setCtlTheme =

== Syntax ==

int setCtlTheme(int n, int state)

== Arguments ==

:n

::The index number of the control to change

:state

::Theme state of the control. Set to -1 for the default theme, 0 to disable themes, or 1 to enable Windows Themes on this control.

== Return ==

Returns -1 if the control number is out of range or not in use, otherwise it returns S_OK if the function succeeded, or an HRESULT error code as returned by the [SetWindowTheme Win32 API function].

== Description ==

Enables or disables the modern Windows UI theme (from XP/Vista onwards) for a specific control. Note that the control may not adopt the modern theme if your host graphics program is running in a compatibility mode that emulates an older version of Windows.

== Example ==

<code>

%ffp

Category: "FilterMeister"

Author: "Harald Heim"

Title: "Theme Demo"

Filename: "ThemeDemo.8bf"

Copyright: "No Copyright"

Description:"Theme Demo"

Version: "1.0"

URL: "http://thepluginsite.com"

About: "!T \n!D\n"

"!c\n!U"

Dialog: Theme=on

ctl(0): "Slider"//,theme=off

ctl(1): CHECKBOX, "Checkbox"//, color=COLOR_BTNFACE

ctl(2): STATICTEXT, "statictext"

ctl(3): PUSHBUTTON, "Button"//,theme=on

ctl(5): COMBOBOX, "Combobox", val=0

ctl(8): CHECKBOX, "Activate Theme"

OnCtl(n):{

if (n==8 && e==FME_CLICKED){

setDialogTheme(ctl(8));

setCtlTheme(CTL_PROGRESS,ctl(8));

setCtlTheme(CTL_ZOOM,ctl(8));

setCtlTheme(CTL_FRAME,ctl(8));

refreshCtl(CTL_FRAME);//Avoid Redraw problems

setCtlTheme(0,ctl(8));

setCtlTheme(1,ctl(8));

setCtlTheme(2,ctl(8));

setCtlTheme(3,ctl(8));

setCtlTheme(5,ctl(8));

//Info ("%d",getCtlColor(1));

}

return false;

}

</code>

== See Also ==

setDialogTheme