From: sujeet27kulk on
I am working on an MDI application.My Custom CEdit boxes are moving
with MouseMove on client area of CView derived class. I set
CMDIFrameWnd derived class(CMainWindow ) as parent to my Custom CEdit
boxes which is a need. In certain conditions (due to some other
drawing) CView is redrawing itself while Edit boxes are moving on
MouseMove . When my Edit boxes are in the same rect which CView is
redrawing then they are flickering. I think view is drawing itself on
top of those Cedit boxes. But when I set CView as parent Edit boxes
are not flickerig its working fine. But due to some other requirement
I need to set CMainWindow as parent. Is there anything I can do to
avoid this flickering. I tried by calling RedrawWindow on Edit box
objects but not its not working. Do I need to sen some Message.
Anything that will avoid that flickering? Please help.
From: Joseph M. Newcomer on
Well, I'd say that it pretty much sounds like Windows is doing the Right Thing. Making
the frame window the parent instead of the view window is a deeply suspicious action, and
probably leads to all kinds of problems. I'd suggest at the very least making sure your
frame window has WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles. But you are doing something
pretty far off the wall in terms of sanity, and you should expect that by doing something
this totally weird you will get poor results. I suspect your "some other requirement" is
not well thought out in terms of its consequences, and you are now seeing one of them.
joe
On Fri, 9 May 2008 02:17:32 -0700 (PDT), sujeet27kulk(a)gmail.com wrote:

>I am working on an MDI application.My Custom CEdit boxes are moving
>with MouseMove on client area of CView derived class. I set
>CMDIFrameWnd derived class(CMainWindow ) as parent to my Custom CEdit
>boxes which is a need. In certain conditions (due to some other
>drawing) CView is redrawing itself while Edit boxes are moving on
>MouseMove . When my Edit boxes are in the same rect which CView is
>redrawing then they are flickering. I think view is drawing itself on
>top of those Cedit boxes. But when I set CView as parent Edit boxes
>are not flickerig its working fine. But due to some other requirement
>I need to set CMainWindow as parent. Is there anything I can do to
>avoid this flickering. I tried by calling RedrawWindow on Edit box
>objects but not its not working. Do I need to sen some Message.
>Anything that will avoid that flickering? Please help.
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: sujeet27kulk on
On May 9, 7:44 pm, Joseph M. Newcomer <newco...(a)flounder.com> wrote:
> Well, I'd say that it pretty much sounds like Windows is doing the Right Thing.  Making
> the frame window the parent instead of the view window is a deeply suspicious action, and
> probably leads to all kinds of problems.  I'd suggest at the very least making sure your
> frame window has WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles.  But you are doing something
> pretty far off the wall in terms of sanity, and you should expect that by doing something
> this totally weird you will get poor results.  I suspect your "some other requirement" is
> not well thought out in terms of its consequences, and you are now seeing one of them.  
>                                         joe
>
> On Fri, 9 May 2008 02:17:32 -0700 (PDT), sujeet27k...(a)gmail.com wrote:
> >I am working on an MDI application.My Custom CEdit boxes are moving
> >with MouseMove on client area of CView derived class. I set
> >CMDIFrameWnd derived class(CMainWindow ) as parent to my Custom CEdit
> >boxes which is a need. In certain conditions (due to some other
> >drawing) CView is redrawing itself while Edit boxes are moving on
> >MouseMove . When my Edit boxes are in the same rect which CView is
> >redrawing then they are flickering. I think view is drawing itself on
> >top of those Cedit boxes. But when I set CView as parent Edit boxes
> >are not flickerig its working fine. But due to some other requirement
> >I need to set CMainWindow as parent. Is there anything I can do to
> >avoid this flickering. I tried by calling RedrawWindow on Edit box
> >objects but not its not working. Do I need to sen some Message.
> >Anything that will avoid that flickering? Please help.
>
> Joseph M. Newcomer [MVP]
> email: newco...(a)flounder.com
> Web:http://www.flounder.com
> MVP Tips:http://www.flounder.com/mvp_tips.htm

Hi,
What I mean by other requirement is moving the Edit boxes on
the top of Non-client area of the CView and other windows if any when
the user moves Mouse towards the end of client area. I need to display
the Edit boxes until mouse leaves the Client area of CView.
When I kept CView as parent Edit boxes goes under the non-client area.
So to solve this problem I made FrameWindow parent and Mapped points
of MouseMove to move the Edit boxes.
I tried other solution like setting WS_EX_TOPMOST style in Create but
its not working. When I try to set it in SetWindowPosition I need to
remove existing style SWP_NOZORDER and then the ghost images are
coming and you can see trailing of Edit boxes. Still it didn't serve
my purpose and Edit box goes inside the non-client area of CView.
Also I need to show the Edit boxes on top any winddow present in the
middle of CView's client area until Mouse Leaves the client area of
the CView and enters NC area of that window. But setting WS_EX_TOPMOST
style in create and in SetWindowPosition doesn't solve this problem
too.
Is there anything I can do here so that I need not go for making
FrameWindow parent of Edit boxes? Thanks in advance.
From: sujeet27kulk on
On May 9, 10:26 pm, Joseph M. Newcomer <newco...(a)flounder.com> wrote:
> I would solve this not by using edit controls but by creating a dialog that held the edit
> control; because the dialog is a popup and not a child, you can move it anywhere.  Note
> that you can create a dialog that is borderless and the same size as the edit control!  Do
> this and your problems should go away.
>                                 joe
>
>
>
>
>
> On Fri, 9 May 2008 09:14:59 -0700 (PDT), sujeet27k...(a)gmail.com wrote:
> >On May 9, 7:44 pm, Joseph M. Newcomer <newco...(a)flounder.com> wrote:
> >> Well, I'd say that it pretty much sounds like Windows is doing the Right Thing.  Making
> >> the frame window the parent instead of the view window is a deeply suspicious action, and
> >> probably leads to all kinds of problems.  I'd suggest at the very least making sure your
> >> frame window has WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles.  But you are doing something
> >> pretty far off the wall in terms of sanity, and you should expect that by doing something
> >> this totally weird you will get poor results.  I suspect your "some other requirement" is
> >> not well thought out in terms of its consequences, and you are now seeing one of them.  
> >>                                         joe
>
> >> On Fri, 9 May 2008 02:17:32 -0700 (PDT), sujeet27k...(a)gmail.com wrote:
> >> >I am working on an MDI application.My Custom CEdit boxes are moving
> >> >with MouseMove on client area of CView derived class. I set
> >> >CMDIFrameWnd derived class(CMainWindow ) as parent to my Custom CEdit
> >> >boxes which is a need. In certain conditions (due to some other
> >> >drawing) CView is redrawing itself while Edit boxes are moving on
> >> >MouseMove . When my Edit boxes are in the same rect which CView is
> >> >redrawing then they are flickering. I think view is drawing itself on
> >> >top of those Cedit boxes. But when I set CView as parent Edit boxes
> >> >are not flickerig its working fine. But due to some other requirement
> >> >I need to set CMainWindow as parent. Is there anything I can do to
> >> >avoid this flickering. I tried by calling RedrawWindow on Edit box
> >> >objects but not its not working. Do I need to sen some Message.
> >> >Anything that will avoid that flickering? Please help.
>
> >> Joseph M. Newcomer [MVP]
> >> email: newco...(a)flounder.com
> >> Web:http://www.flounder.com
> >> MVP Tips:http://www.flounder.com/mvp_tips.htm
>
> >Hi,
> >      What  I mean by other requirement is moving the Edit boxes on
> >the top of Non-client area of the CView and other windows if any when
> >the user moves Mouse towards the end of client area. I need to display
> >the Edit boxes until mouse leaves the Client area of CView.
> >When I kept CView as parent Edit boxes goes under the non-client area.
> >So to solve this problem I made FrameWindow parent and Mapped points
> >of MouseMove to move the Edit boxes.
> >I tried other solution like setting WS_EX_TOPMOST style in Create but
> >its not working. When I try to set it in SetWindowPosition I need to
> >remove existing style SWP_NOZORDER and then the ghost images are
> >coming and you can see trailing of Edit boxes. Still it didn't serve
> >my purpose and Edit box goes inside the non-client area of CView.
> >Also I need to show the Edit boxes on top any winddow present in the
> >middle of CView's client area until Mouse Leaves the client area of
> >the CView and enters NC area of that window. But setting WS_EX_TOPMOST
> >style in create and in SetWindowPosition doesn't solve this problem
> >too.
> >Is there anything I can do here so that I need not go for making
> >FrameWindow parent of Edit boxes? Thanks in advance.
>
> Joseph M. Newcomer [MVP]
> email: newco...(a)flounder.com
> Web:http://www.flounder.com
> MVP Tips:http://www.flounder.com/mvp_tips.htm- Hide quoted text -
>
> - Show quoted text -

Thanks for the reply. But that will make things complecaed as I have
to go for modeless dialog (and I have 4 floating Edit boxes) which
will have its own message loop which may create problem in the current
application. And on resizing of edit boxes I need to resize the Dialog
also. Means a lot of changes which I can't afford at this time. Can't
I do something to avoid flickering while keeping CMDIFrameWnd as
Parent?
From: sujeet27kulk on
On May 10, 9:34 pm, Joseph M. Newcomer <newco...(a)flounder.com> wrote:
> See below...
>
>
>
>
>
> On Sat, 10 May 2008 05:33:22 -0700 (PDT), sujeet27k...(a)gmail.com wrote:
> >On May 9, 10:26 pm, Joseph M. Newcomer <newco...(a)flounder.com> wrote:
> >> I would solve this not by using edit controls but by creating a dialog that held the edit
> >> control; because the dialog is a popup and not a child, you can move it anywhere.  Note
> >> that you can create a dialog that is borderless and the same size as the edit control!  Do
> >> this and your problems should go away.
> >>                                 joe
>
> >> On Fri, 9 May 2008 09:14:59 -0700 (PDT), sujeet27k...(a)gmail.com wrote:
> >> >On May 9, 7:44 pm, Joseph M. Newcomer <newco...(a)flounder.com> wrote:
> >> >> Well, I'd say that it pretty much sounds like Windows is doing the Right Thing.  Making
> >> >> the frame window the parent instead of the view window is a deeply suspicious action, and
> >> >> probably leads to all kinds of problems.  I'd suggest at the very least making sure your
> >> >> frame window has WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles.  But you are doing something
> >> >> pretty far off the wall in terms of sanity, and you should expect that by doing something
> >> >> this totally weird you will get poor results.  I suspect your "some other requirement" is
> >> >> not well thought out in terms of its consequences, and you are now seeing one of them.  
> >> >>                                         joe
>
> >> >> On Fri, 9 May 2008 02:17:32 -0700 (PDT), sujeet27k...(a)gmail.com wrote:
> >> >> >I am working on an MDI application.My Custom CEdit boxes are moving
> >> >> >with MouseMove on client area of CView derived class. I set
> >> >> >CMDIFrameWnd derived class(CMainWindow ) as parent to my Custom CEdit
> >> >> >boxes which is a need. In certain conditions (due to some other
> >> >> >drawing) CView is redrawing itself while Edit boxes are moving on
> >> >> >MouseMove . When my Edit boxes are in the same rect which CView is
> >> >> >redrawing then they are flickering. I think view is drawing itself on
> >> >> >top of those Cedit boxes. But when I set CView as parent Edit boxes
> >> >> >are not flickerig its working fine. But due to some other requirement
> >> >> >I need to set CMainWindow as parent. Is there anything I can do to
> >> >> >avoid this flickering. I tried by calling RedrawWindow on Edit box
> >> >> >objects but not its not working. Do I need to sen some Message.
> >> >> >Anything that will avoid that flickering? Please help.
>
> >> >> Joseph M. Newcomer [MVP]
> >> >> email: newco...(a)flounder.com
> >> >> Web:http://www.flounder.com
> >> >> MVP Tips:http://www.flounder.com/mvp_tips.htm
>
> >> >Hi,
> >> >      What  I mean by other requirement is moving the Edit boxes on
> >> >the top of Non-client area of the CView and other windows if any when
> >> >the user moves Mouse towards the end of client area. I need to display
> >> >the Edit boxes until mouse leaves the Client area of CView.
> >> >When I kept CView as parent Edit boxes goes under the non-client area.
> >> >So to solve this problem I made FrameWindow parent and Mapped points
> >> >of MouseMove to move the Edit boxes.
> >> >I tried other solution like setting WS_EX_TOPMOST style in Create but
> >> >its not working. When I try to set it in SetWindowPosition I need to
> >> >remove existing style SWP_NOZORDER and then the ghost images are
> >> >coming and you can see trailing of Edit boxes. Still it didn't serve
> >> >my purpose and Edit box goes inside the non-client area of CView.
> >> >Also I need to show the Edit boxes on top any winddow present in the
> >> >middle of CView's client area until Mouse Leaves the client area of
> >> >the CView and enters NC area of that window. But setting WS_EX_TOPMOST
> >> >style in create and in SetWindowPosition doesn't solve this problem
> >> >too.
> >> >Is there anything I can do here so that I need not go for making
> >> >FrameWindow parent of Edit boxes? Thanks in advance.
>
> >> Joseph M. Newcomer [MVP]
> >> email: newco...(a)flounder.com
> >> Web:http://www.flounder.com
> >> MVP Tips:http://www.flounder.com/mvp_tips.htm-Hide quoted text -
>
> >> - Show quoted text -
>
> >Thanks for the reply. But that will make things complecaed as I have
> >to go for modeless dialog (and I have 4 floating Edit boxes) which
> >will have its own message loop which may create problem in the current
> >application. And on resizing of edit boxes I need to resize the Dialog
> >also. Means a  lot of changes which I can't afford at this time. Can't
> >I do something to avoid flickering while keeping CMDIFrameWnd as
> >Parent?
>
> ****
> It is not complicated at all.  Not nearly as complicated as trying to come up with a fix
> for which no fix is likely possible!  I seriously doubt that it is possible to create a
> fix for this problem.  The first and most important decision you should make is that ANY
> time you either call SetParent or try to use the MDI frame for anything, you should
> IMMEDIATELY say "this is completely wrong, I need a different approach".  That would have
> saved you the problem of getting so far down an erroneous path you don't have time to back
> out.  But I suspect there IS no solution to your problem given your current approach.
>                                 joe
> ****
> Joseph M. Newcomer [MVP]
> email: newco...(a)flounder.com
> Web:http://www.flounder.com
> MVP Tips:http://www.flounder.com/mvp_tips.htm- Hide quoted text -
>
> - Show quoted text -

Can I somehow imitate Pop-up behaviour of dilaog boxes in Edit cntrols?