From: green on
Thank you Joseph,

Your idea seems good and ... ,
Let me try!

By the why , late I will upload my test source code and the app (exe file).

Merry Christmas and a Happy New Year!

"Joseph M. Newcomer" <newcomer(a)flounder.com>
??????:rpt4j59avpte2ucm5l99vkopshcn361du1(a)4ax.com...
> It looks like you have a one-pixel error. Be aware that GDI coordinates
> in GM_COMPATIBLE
> mode (the default, unless you have set GM_ADVANCED, which is rarely done)
> are 1 smaller
> than the object. So you might try adding 1 to the right/width and
> bottom/height of
> computations and see if that fixes the problem.
>
> Note: given a choice of representing x0-to-x1 using either the value x1-1
> or x1, no matter
> which choice is made, it will be wrong. Over the years, I have worked
> with several
> graphics systems. Some of them used x1, some used x1-1. Each will give
> you problems. The
> x1-1 generally has fewer problems. In either system you end up in some
> contexts either
> adding 1 (for those that give x1-1) or subtracting 1 (for those that give
> x1) so there is
> no one "right" solution.
> joe
>
> On Wed, 23 Dec 2009 13:33:38 +0800, "green" <greenabc300(a)hotmail.com>
> wrote:
>
>>Hello, every one!
>>
>>Ownerdraw main window , I used SetWindowRgn to cut down the four corners,
>>but there will left something drawing here when you drag the corners and
>>borders to resized the window on the background of the main window. Only 3
>>corners of the four corners do this.
>>
>>
>>Thanks a lot!
>>
>>
> Joseph M. Newcomer [MVP]
> email: newcomer(a)flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


From: David Ching on
"green" <greenabc300(a)hotmail.com> wrote in message
news:#dC6vxajKHA.1652(a)TK2MSFTNGP05.phx.gbl...
> Hi, Everyone!
>
> Ownerdraw main window , I used SetWindowRgn to cut down the four corners,
> but there will left something drawing here when you drag the corners and
> borders to resized the window on the background of the main window. Only 3
> corners of the four corners do this.
>
> I used HDC hWindowDC = GetWindowDC();
> Draw the non client area on hWindowDC
>
> In class of WTL:
>
> class CMainFrame : public CFrameWindowImpl<CMainFrame>, public
> CUpdateUI<CMainFrame>,
> public CMessageFilter, public CIdleHandler
>


I've not used hWindowDC after SetWindowRgn before. Why don't you use a
client DC? Why do you need to draw the non-client area after you've cut
down (I assume you mean rounded) corners? I've used SetWindowRgn (
CreateRoundRectRgn(...) ) with good success.

-- David