Link to home
Start Free TrialLog in
Avatar of galkin
galkin

asked on

Drawing control on memory device context

I need control( for example button) to draw itself on memory device context.
I created this device context and call ::SendMessage(hwndControl, WM_PAINT,
(WPARAM)memDC.GetSafeHdc(), 0). The problem is that in this case invalid
rectangle is empty and control doesn't paint itself. If I specify
InvalidateRect(NULL) before sending message then control does paint itself
on memory DC but it also paints itself on window DC. I also tried to call
ValidateRect(NULL) just after sending message but it doesn't help. How can I
force control to draw itself on memory DC only?
            Thanks.
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial