Hi Andrew
Thanks for reply. Sure, i use constants from <tmschema.h>.
But nothing works yet. Amazing
PS: below is my prosedure:
---------------------------
internal static Color GetThemeColor(ControlPart part, ControlState state,
int iColorID)
{
int result;
int theme ;
// Check to make sure the current system supports themes
if (!SupportsThemes)
throw (new PlatformNotSupportedException("This system does not support the
use of themes."));
// Get the active Windows XP theme for the specified type of control
Themes.ControlClass cp= ControlPartClasses[(int)part];
string s= ControlClassNames[(int)cp];
theme = OpenThemeData(HandleTemp, s); // "WINDOWS"
if (theme == 0)
throw (new NullReferenceException("No active Windows XP Theme could be
detected."));
int ColorRef= new Int32();
result= GetThemeColor(theme, (int) part, (int) state, iColorID, ref
ColorRef);
Color cr= Color.White;
if(ColorRef!=0)
cr=ColorTranslator.FromWin32(ColorRef);
result = CloseThemeData(theme);
if (result != 0)
throw (new InvalidOperationException("The call to CloseThemeData failed with
an error code of " + result.ToString() + "."));
return cr;
}
---------------
Thanks
Yuri
"Andrew (Infragistics)" <
[email protected]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ ×
ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ: news:
[email protected]...
The api looks correct. What are you passing for the iColorID? e.g. For the
border color, you'd use 3801.
yuri said:
Hi Hiroaki
Yes, I'm coding in C#. The 'OpenThemeData' is succeeded and gives me a
correct theme handler that i use nice with any theme-specific functions.
Also GetThemeSysColor is working correctly.
Below is my declaration:
[DllImport("uxtheme.dll", CharSet=CharSet.Auto)]
private static extern int GetThemeColor(int hTheme,int Part,int State,int
iColorID,ref int ColorRef);
PS: I tried to pass WINDOW as control part with different states and color
with no successful result.
As a result I am receiving always error "element not found".
PS1: If you know any correct template when this call succeeded please post
it here.
Thank you
Yuri
"Hiroaki SHIBUKI [MVP]" <
[email protected]>
$B'c'`'`'R'k'Z'](B/$B'c'`'`'R'k'Z']'Q(B $B'S(B
$B'_'`'S'`'c'd'q'g(B $B'c']'V'U'e'p'k'V'V(B:
Hi,
At coding XP Themes i can't get "GetThemeColor" to work.
It always fails ("not found" err. code) regardless of which control
parts
and states entered.
Are you coding in C#? and did you success 'OpenThemeData' ?
Could somebody help me with advice?
Please show me your declearation of 'GetThemeColor'.
--
Hiroaki SHIBUKI
Hi all
At coding XP Themes i can't get "GetThemeColor" to work.
It always fails ("not found" err. code) regardless of which control
parts
and states entered.
Could somebody help me with advice?
Yuri