Click here to Skip to main content
15,914,368 members
Home / Discussions / C#
   

C#

 
QuestionHow to use uxtheme APIs in custom control? Pin
Li-kai Liu (Angus)6-Aug-02 0:13
Li-kai Liu (Angus)6-Aug-02 0:13 
AnswerRe: How to use uxtheme APIs in custom control? Pin
James T. Johnson6-Aug-02 1:49
James T. Johnson6-Aug-02 1:49 
GeneralRe: How to use uxtheme APIs in custom control? Pin
Li-kai Liu (Angus)6-Aug-02 19:20
Li-kai Liu (Angus)6-Aug-02 19:20 
Hi, James

The thing you addressed in the second part using P/Inovoke
is what I've done in my program. But it's still not working.
I've already had my unmanaged function declared as you did
in the post. And it looks to me that OpenThemeData doesn't
work as it should do. I had another uxtheme API

static public extern bool IsThemeActive();

It works very well. But just don't know why OpenThemeData
always return Null whenever I call it.

Part of the code in my control is as follow:
protected override void OnPaint(PaintEventArgs pe) {

IntPtr hTheme = OpenThemeData(this.Handle , "button");

if (hTheme != IntPtr.Zero)
{
// draw themed control
}
else
{
// draw normal control
}
}

However, OpenThemeData always return Null...

Am I doing right with this?

Thanks!
GeneralRe: How to use uxtheme APIs in custom control? Pin
James T. Johnson6-Aug-02 19:43
James T. Johnson6-Aug-02 19:43 
GeneralRe: How to use uxtheme APIs in custom control? Pin
Li-kai Liu (Angus)7-Aug-02 1:03
Li-kai Liu (Angus)7-Aug-02 1:03 
GeneralRe: How to use uxtheme APIs in custom control? Pin
James T. Johnson7-Aug-02 1:07
James T. Johnson7-Aug-02 1:07 
GeneralRe: How to use uxtheme APIs in custom control? Pin
Li-kai Liu (Angus)7-Aug-02 11:20
Li-kai Liu (Angus)7-Aug-02 11:20 
GeneralRe: How to use uxtheme APIs in custom control? Pin
James T. Johnson7-Aug-02 15:06
James T. Johnson7-Aug-02 15:06 
GeneralRe: How to use uxtheme APIs in custom control? Pin
Li-kai Liu (Angus)7-Aug-02 17:45
Li-kai Liu (Angus)7-Aug-02 17:45 
GeneralDataReader Pin
Mazdak5-Aug-02 20:44
Mazdak5-Aug-02 20:44 
GeneralRe: DataReader Pin
SimonS5-Aug-02 22:13
SimonS5-Aug-02 22:13 
GeneralRe: DataReader Pin
Mazdak6-Aug-02 19:12
Mazdak6-Aug-02 19:12 
GeneralRe: DataReader Pin
James T. Johnson6-Aug-02 19:35
James T. Johnson6-Aug-02 19:35 
GeneralIDE Controls Help Pin
BLaZiNiX5-Aug-02 14:24
BLaZiNiX5-Aug-02 14:24 
GeneralRe: IDE Controls Help Pin
jparsons6-Aug-02 6:22
jparsons6-Aug-02 6:22 
GeneralRe: IDE Controls Help Pin
BLaZiNiX6-Aug-02 13:01
BLaZiNiX6-Aug-02 13:01 
GeneralRe: IDE Controls Help Pin
leppie7-Aug-02 2:21
leppie7-Aug-02 2:21 
GeneralRe: IDE Controls Help Pin
leppie7-Aug-02 3:06
leppie7-Aug-02 3:06 
GeneralCustom Controls Pin
mbp5-Aug-02 14:19
mbp5-Aug-02 14:19 
GeneralResizable dialog Pin
Christian Graus5-Aug-02 13:03
protectorChristian Graus5-Aug-02 13:03 
GeneralRe: Resizable dialog Pin
Christian Graus5-Aug-02 13:09
protectorChristian Graus5-Aug-02 13:09 
Generalpure c# unsigned short* Pin
Anonymous5-Aug-02 12:36
Anonymous5-Aug-02 12:36 
GeneralControl on Control Pin
Nnamdi Onyeyiri5-Aug-02 9:40
Nnamdi Onyeyiri5-Aug-02 9:40 
GeneralRe: Control on Control - SOLVED Pin
Nnamdi Onyeyiri5-Aug-02 9:58
Nnamdi Onyeyiri5-Aug-02 9:58 
GeneralRe: Control on Control - SOLVED Pin
Nish Nishant5-Aug-02 10:00
sitebuilderNish Nishant5-Aug-02 10:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.