Hi

Is it ok to call GetWindowDC twice on the same window before ReleaseDC ?

HDC dc1 = GetWindow(hWin1);
HDC dc2 = GetWindow(hWin1);
...
ReleaseDC(hWin1, dc2);
ReleaseDC(hWin1, dc1);

I usualy only do it once but I noticed that sometimes my drawings
calls generate a WM_PAINT message and then id get BeginPaint
EndPaint which pretty much does get/release of dcs.

thanks a lot.

Re: GetWindowDC twice by David

David
Tue Mar 02 11:21:06 CST 2004

>Is it ok to call GetWindowDC twice on the same window before ReleaseDC ?

I don't see why you shouldn't - presumably you've tried it?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Re: GetWindowDC twice by a

a
Tue Mar 02 17:03:34 CST 2004


"David Lowndes" <davidl@example.invalid> wrote in message
news:jig940h3lutp2g0mr3qth93o3eddsbcu48@4ax.com...
> >Is it ok to call GetWindowDC twice on the same window before ReleaseDC ?
>
> I don't see why you shouldn't - presumably you've tried it?
>
> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq

I was actualy having all kinds of problems because i called ReleaseDC
needlessly. But now everything seems ok. I just wasnt sure. Thats why
i asked .


thanks