Re: Using custom dialog template for Pagesetup dialog
"arasakumaran" <arasakumaran-/[email protected]>
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <[email protected]> |
--- In [email protected], "Jeff Henkels" <jeff@...> wrote: > > "arasakumaran" <arasakumaran@...> wrote > in message news:gqrvrv+7omt@... > > Thanks Mike. I had seen that about the same time. I now can get my > > dialog. But have not > > yet figured out how to use the HookProc, or even if I need to do it. May > > be I just place > > a message map and see if the messages get routed to my class. > > I just went through this with CFileDialog. You don't need to do a hookproc; > the base class implements its own hookproc & calls overridable functions for > the various uMsg values the hookproc receives. Your message map should work > fine without any modification. Some other weirdnesses I noticed: > > 1. In your WM_INITDIALOG handler, the HWND parameter will be NULL -- the > class's m_hWnd is your template dialog, which is a child control of the > common dialog. GetParent() returns the hDlg for the common dialog, so > GetParent().GetDlgItem(x) will return the appropriate common dialog control, > and GetDlgItem(x) will return the appropriate control in your template > dialog. > > 2. If you're going to move controls around in your WM_INITDIALOG handler, > remember that your template dialog is itself a child control of the common > dialog. So when you get the windowrect for one of your template controls, > and if you're using SetWindowPos to move the control, you'll need to do a > GetParent().ScreenToClient on the window rect to make its coordinates > relative to the common dialog. > > 3. Again in the WM_INITDIALOG handler, the LPARAM parameter is a pointer to > the OPENFILENAME (or in your case PAGESETUPDLG) struct. This probably won't > be too useful since the struct is a public member of the base class, and is > thus easily accessible anyway. > > 4. Make sure your class derives from CPageSetupDialogImpl, not > CPageSetupDialog. Also make sure your message map includes a CHAIN_MSG_MAP > entry to CPageSetupDialogImpl. > Thank you very much for all the info. I had figured out most of it, but the part about how to get at the controls for the basic dialog is new details. I have my dialog working now. ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wtl/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/wtl/join (Yahoo! ID required) <*> To change settings via email: mailto:[email protected] mailto:[email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/