Painting with win32.
-
Hi, Are there functions available in the windows api that will paint windows controls to a certain rectangle using GDI. Something similar to the ControlPaint class in .NET. If there are, can someone point me to the documentation that details how to use them. Thanks Steve
-
Hi, Are there functions available in the windows api that will paint windows controls to a certain rectangle using GDI. Something similar to the ControlPaint class in .NET. If there are, can someone point me to the documentation that details how to use them. Thanks Steve
If the control handles
WM_PRINTCLIENT
, you can send it that message to have it paint into a DC.--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze
-
If the control handles
WM_PRINTCLIENT
, you can send it that message to have it paint into a DC.--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze
I don't have an instance of a control. All I want to do, is call some routine that will paint me a button to a specified DC, like the ButtonRenderer.DrawButton method for the .NET framework. This allows you to pass an arbitrary Graphics object and some state information and it will draw a button using windows styles to it without needing an instance of Button.
-
If the control handles
WM_PRINTCLIENT
, you can send it that message to have it paint into a DC.--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze
How can you specify a rectangle for WM_PRINTCLIENT?
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
I don't have an instance of a control. All I want to do, is call some routine that will paint me a button to a specified DC, like the ButtonRenderer.DrawButton method for the .NET framework. This allows you to pass an arbitrary Graphics object and some state information and it will draw a button using windows styles to it without needing an instance of Button.
Have a look at OpenThemeData[^], DrawThemeBackground[^] and related methods, but note that these only work under Windows XP (and i supose above) with themes enabled, so it might not be enough for your needs.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
I don't have an instance of a control. All I want to do, is call some routine that will paint me a button to a specified DC, like the ButtonRenderer.DrawButton method for the .NET framework. This allows you to pass an arbitrary Graphics object and some state information and it will draw a button using windows styles to it without needing an instance of Button.