-
July 20th, 2010, 08:55 PM
#1
Moving MFC CDialog
Hi,
My question is: what windows messages are sent to dialogs child controls when the user moves the dialog windowover the screen?
I checked WM_MOVING, WN_MOVE, WM_SIZE handlers in child controls. Noneis called.
OnPaint also is not called.
Seems like the dialog just moves its bitmap.
I am asking this question because I have a popup window over one of controls, like a tool tip (derived from CWnd). When the dialog is moving, the popup stays put. I need to keep popup relative position relative to the control the same all the time and I don't know how to do it.
Any help is greatly appreciated.
-
July 21st, 2010, 03:12 AM
#2
Re: Moving MFC CDialog
Try to handle WM_MOVE for dialog window and send your message to child control
-
July 21st, 2010, 03:19 AM
#3
Re: Moving MFC CDialog
Originally Posted by geoyar
Hi,
My question is: what windows messages are sent to dialogs child controls when the user moves the dialog windowover the screen?
I checked WM_MOVING, WN_MOVE, WM_SIZE handlers in child controls. Noneis called.
OnPaint also is not called.
How did you check it? Using Spy++?
What are you trying to achieve?
Victor Nijegorodov
-
July 21st, 2010, 09:16 AM
#4
Re: Moving MFC CDialog
There is no WM_MOVE, WM_SIZE, WM_MOVING or whatever message being send to your child controls when you just move the parent because the children are NOT moving relativly to the parent. Remember that child position is always relative to upper left corner of the parent.
You also don't see WM_PAINT messages because you are probably running on Windows Vista or Windows 7 with desktop composition enabled which means that your window is basically just a texture on your video-card and when moving the video-card will simply translate that texture.
What you should do is handle the WM_MOVE or WM_MOVING messages on the parent level and then use SetWindowPos to change the position of the popup.
-
July 22nd, 2010, 01:03 PM
#5
Re: Moving MFC CDialog
I have a popup window over one of controls, like a tool tip (derived from CWnd). When the dialog is moving, the popup stays put.
Think about making it a child rather than popup. Then dialog will move it as any other child.
Best regards,
Igor
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|