August 24th, 2010, 06:49 AM
Getting Control HBitmap
Hello, I'm trying to get HBitmap from Graphics Control handle.
I do it like here:
I working with Windows 7 and VS2010 (C# .NET 4.0).
var controlGraphics = m_control.CreateGraphics();
var controlHdc = controlGraphics.GetHdc();
var controlHBitmap = PInvoke.GetCurrentObject( controlHdc, PInvoke.OBJ_BITMAP );
I use standard WinAPI functions like u can see.
It's working good in normal situation, but when I set Win 7 system options to "Fit to best performance" (its turning off nice graphics Win 7 effects and set simplest possible themes i think) this method don't work.
Method "GetCurrentObject" return me handle to desktop HBitmap - not to control. It can be fixed in some way, or it smth with system whereof i dont know?
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!