Click here to Skip to main content
11,411,922 members (61,956 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC
I have an application which has many dialogs. I have positioned dialogs on main / parent dialog initially. Whenever there is a change in screen resolution I have capture the co-ordinates in WM_SETTINGCHANGE handler. While changing the screen resolution this handler calculates the current co-ordinates but to show the dialog in proper place I need to close he dialog and reopen it again where in OnInitdialog it gets the new co-ordinates and re-position the window. But I want that dialog shd be re-positioned whenever there is a change in screen resolution. I tried to capture WM_SETTINGCHANGE in chiled dialog but this handler doesn't get called when screen resolution changes.
Pls let me know how to send message to child dialog to re-position whenever there is a change in screen resolution?
Posted 28-Apr-13 22:06pm
SNI1.5K
Comments
CPallini at 29-Apr-13 3:33am
   
Probably I didn't get you, however: If you correctly get the WM_SETTINGCHANGE in your main window then, there, you can call a method on all your dialog children to make them change position, can't you?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

From within the WM_SETTINGCHANGE handler of your main window you can send this message (or a user defined one) to all descendant windows using SendMessageToDescendants[^].
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 268
1 Sergey Alexandrovich Kryukov 200
2 Sascha Lefévre 170
3 ProgramFOX 130
4 Maciej Los 110
0 Sergey Alexandrovich Kryukov 8,955
1 OriginalGriff 7,158
2 Maciej Los 3,480
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web04 | 2.8.150414.5 | Last Updated 29 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100