Click to See Complete Forum and Search --> : Static dialog control location


XLOGIC11
July 5th, 2002, 12:59 PM
I'm using BitBlt to paint the background of a static dialog control. I've already painted to rest of the background (entire screen except for tha Nav bar and Menu bar) in my OnEraseBkgnd routine.


How do I calc the xSrc and ySrc for the source from the bitmap.

What I know...

1. The static in the dialog resource is at 11,87,137,8

2. GetClipBox returns 0, 13, 0, 205

I know that the correct numbers for xSrc and ySrc are 16, 142.

But how should these values be calculated at run time.

undiwahn
July 10th, 2002, 03:50 PM
If I understand correctly, you're trying to figure out where to paint the background on the parent window so that it's behind the Static control?

I usually do it like so:

GetWindowRect() on static control
ScreenToClient() on parent window

That should give you a rect that describes the location of the Static control in the parent window's coordinates

If anyone has a better way of doing it...