Click here to Skip to main content
15,889,808 members
Home / Discussions / C#
   

C#

 
GeneralReturning by Ref Pin
gekoscan6-Aug-02 6:35
gekoscan6-Aug-02 6:35 
GeneralRe: Returning by Ref Pin
Nnamdi Onyeyiri6-Aug-02 7:10
Nnamdi Onyeyiri6-Aug-02 7:10 
GeneralRe: Returning by Ref Pin
Andy Smith6-Aug-02 9:19
Andy Smith6-Aug-02 9:19 
QuestionProblem in Running in Other Platform! Why? Pin
DotNet6-Aug-02 1:24
DotNet6-Aug-02 1:24 
AnswerRe: Problem in Running in Other Platform! Why? Pin
James T. Johnson6-Aug-02 1:50
James T. Johnson6-Aug-02 1:50 
AnswerRe: Problem in Running in Other Platform! Why? Pin
Johnny Zee6-Aug-02 4:33
sussJohnny Zee6-Aug-02 4:33 
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 
Li-kai Liu (Angus) wrote:
I'm wrting a custom control that will use theme library to
draw my control.


Unless you are doing something special the "easy" thing to do is to create a manifest file for your application and set the FlatStyle of your controls to FlatStyle.System.

If you want to go this route, Chris Sells' website[^] has a manifest file for VS.NET, you can use this same file for your application just rename it to myapp.exe.manifest.

That said, on to your other question.

Li-kai Liu (Angus) wrote:
What's P/Invoke?

P/Invoke is a method of executing functions from a C-style dll in a .NET program.

The first step is to declare the function you wish to use and the file that it is in. I'll use OpenThemeData as an example. There is a step embedded in this first step, in that you have to convert all the types used into .NET equivalent types. This is something you learn with practice and time.

[DllImport("uxtheme.dll")]
public extern static IntPtr OpenThemeData(IntPtr hwnd, string pszClassList);


Note that since the second parameter is a wide string (unicode) I could just pass the string in directly and not have to involve the MarshalAs attribute.

For more information look up the DllImport and MarshalAs attributes up in MSDN. If you have to pass structures around you'll probably also need to look at the StructLayout attribute.

HTH,

James
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 
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 

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.