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
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
drawthemebackground (uxtheme)
 
.

Draws the border and fill defined by the visual style for the specified control part.

C# Signatures:

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

[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:

RECT

Notes:

None.

Tips & Tricks:

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:

System.Windows.Forms.VisualStyles.VisualStyleRender.DrawBackground

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