From: green on 23 Dec 2009 00:48 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 --------------------------------------------------------------------------------------------- "green" <greenabc300(a)hotmail.com> д����Ϣ����:e4v77F5gKHA.3792(a)TK2MSFTNGP02.phx.gbl... > 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! > > > >
From: David Ching on 23 Dec 2009 14:03 I haven't seen SetWindowRgn being used on an overlapped window (one containing the caption bar with the minimize, maximize, close buttons) before. Windows normally draws that non-client area. Are you running on Aero? I've seen people report issues that they can no longer custom paint the non-client area on Aero, maybe this is related to trying to use SetWindowRgn to limit the painting of it. I have only seen SetWindowRgn used successfully with WS_POPUP windows which don't have the caption bar. -- David "green" <greenabc300(a)hotmail.com> wrote in message news:uvUQRO5gKHA.3888(a)TK2MSFTNGP02.phx.gbl... > 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 > > > --------------------------------------------------------------------------------------------- > "green" <greenabc300(a)hotmail.com> > д����Ϣ����:e4v77F5gKHA.3792(a)TK2MSFTNGP02.phx.gbl... >> 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! >> >> >> >> > >
From: Joseph M. Newcomer on 23 Dec 2009 15:05 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: Joseph M. Newcomer on 23 Dec 2009 15:18 My essay on SetWindowRgn, which has a cat-shaped region, is a top-level window. But it doesn't have a caption, so I'm not sure this is relevant. joe On Wed, 23 Dec 2009 11:03:05 -0800, "David Ching" <dc(a)remove-this.dcsoft.com> wrote: >I haven't seen SetWindowRgn being used on an overlapped window (one >containing the caption bar with the minimize, maximize, close buttons) >before. Windows normally draws that non-client area. Are you running on >Aero? I've seen people report issues that they can no longer custom paint >the non-client area on Aero, maybe this is related to trying to use >SetWindowRgn to limit the painting of it. I have only seen SetWindowRgn >used successfully with WS_POPUP windows which don't have the caption bar. > >-- David > > >"green" <greenabc300(a)hotmail.com> wrote in message >news:uvUQRO5gKHA.3888(a)TK2MSFTNGP02.phx.gbl... >> 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 >> >> >> --------------------------------------------------------------------------------------------- >> "green" <greenabc300(a)hotmail.com> >> д����Ϣ����:e4v77F5gKHA.3792(a)TK2MSFTNGP02.phx.gbl... >>> 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: green on 23 Dec 2009 21:36 Thank you David and Joe, Merry Christmas and a Happy New Year! "Joseph M. Newcomer" <newcomer(a)flounder.com> ??????:bfu4j5ls8v719g0iq8jp69k9d27gkl2f93(a)4ax.com... > My essay on SetWindowRgn, which has a cat-shaped region, is a top-level > window. But it > doesn't have a caption, so I'm not sure this is relevant. > joe > > On Wed, 23 Dec 2009 11:03:05 -0800, "David Ching" > <dc(a)remove-this.dcsoft.com> wrote: > >>I haven't seen SetWindowRgn being used on an overlapped window (one >>containing the caption bar with the minimize, maximize, close buttons) >>before. Windows normally draws that non-client area. Are you running on >>Aero? I've seen people report issues that they can no longer custom paint >>the non-client area on Aero, maybe this is related to trying to use >>SetWindowRgn to limit the painting of it. I have only seen SetWindowRgn >>used successfully with WS_POPUP windows which don't have the caption bar. >> >>-- David >> >> >>"green" <greenabc300(a)hotmail.com> wrote in message >>news:uvUQRO5gKHA.3888(a)TK2MSFTNGP02.phx.gbl... >>> 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 >>> >>> >>> --------------------------------------------------------------------------------------------- >>> "green" <greenabc300(a)hotmail.com> >>> д����Ϣ����:e4v77F5gKHA.3792(a)TK2MSFTNGP02.phx.gbl... >>>> 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
|
Next
|
Last
Pages: 1 2 Prev: GDI/GDI+ stop drawing after a while on Windows 7 Next: wm_touch and wm_gesture Message |