Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

DrawThemeBackground (uxtheme)
 
.
Summary
TODO - a short description

C# Signature:

C# Signatures:

[DllImport("uxtheme", ExactSpelling=true)]
public extern static Int32 DrawThemeBackgroundEx(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref RECT pRect, ref DTBGOPTS poptions);

VB .NET Signature:

Declare Function DrawThemeBackgroundEx Lib "uxtheme.dll" (TODO) As TODO
public extern static Int32 DrawThemeBackground(IntPtr hTheme, IntPtr hdc, int iPartId,
   int iStateId, ref RECT pRect, ref RECT pClipRect);

<DllImport("uxtheme", ExactSpelling := True)> _
Public Shared Function DrawThemeBackgroundEx(hTheme As IntPtr, hdc As IntPtr, iPartId As Integer, iStateId As Integer, ByRef pRect As RECT, ByRef poptions As DTBGOPTS) As Int32
End Function
[DllImport("uxtheme", ExactSpelling=true)]
public extern static Int32 DrawThemeBackground(IntPtr hTheme, IntPtr hdc, int iPartId,
   int iStateId, ref RECT pRect, IntPtr pClipRect);

VB Signatures:

Declare Function DrawThemeBackground Lib "uxtheme.dll" (TODO) As TODO

<DllImport("UxTheme.dll", CallingConvention:=CallingConvention.Cdecl)> _
Function DrawThemeBackground(ByVal hTheme As IntPtr, ByVal hdc As IntPtr, _
   ByVal iPartId As Integer, ByVal iStateId As Integer, ByRef pRect As RECT, _
   ByRef pClipRect As RECT) As Integer
End Function

User-Defined Types:

None.

RECT

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Sample

'Draw a button in the Statusbar (check the website for the API calls)
Dim posX As Integer = Me.Width - 5 * 20
Dim g As Graphics = Graphics.FromHdc(New IntPtr(GetWindowDC(Me.Handle.ToInt32)))
'drawThemeBackground(openThemeData(Me.Handle, "Window"), g.GetHdc, 15, 1, New RECT(New Rectangle(posX, 5, 20, 20)), IntPtr.Zero)
drawThemeBackground(openThemeData(Me.Handle, "ExplorerBar"), g.GetHdc, 7, 1, New RECT(New Rectangle(posX, 6, 20, 20)), IntPtr.Zero)

Alternative Managed API:

TODO

System.Windows.Forms.VisualStyles.VisualStyleRender.DrawBackground

Documentation
Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions