Solved

PreCreateWindow() not getting hit in a Dialog

Posted on 1998-12-02
4
607 Views
Last Modified: 2013-11-20
I have a dialog created in resource editor as a child, no border, control.  Now I want to modify those styles programmatically with ModifyStyle, but since it isn't working correctly I go to PreCreateWindow and modify the createstruct just to test things out.  I find that PreCreateWindow()isn't being hit at all now.  What could cause this?  I'm creating the dialog like this:  (modeless)

      CUserDialog* UserDlg = new CUserDialog(rect);
      UserDlg->Create(IDD_USER, NULL);
0
Comment
Question by:appleby
  • 2
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
Bridge earned 60 total points
Comment Utility
What styles do you want to change?
If its the border style set it to on in the resource editor, then turn it off in the InitDialog override. After this you will be able to change it correctly at will.

Dialog construction doesnt call PreCreateWindow.
0
 

Author Comment

by:appleby
Comment Utility
I want to change Child to Popup, No borders to borders, turn off Control.  Basically anything that needs to be done to change a dialog from being a child of another dialog to being able to stand on its own as a separate dialog.

Why doesn't dialog construction call PreCreateWindow?  Or maybe a better question is, how do you find this stuff out, when it isn't documented in the class docs?  I have tried going back to classwizard as a que - if it is listed and able to be inserted automatically, I was hoping it meant it got called, but this is obviously not true since you have to add oninitdialog manually, and you can add precreatewindow automatically.
0
 
LVL 1

Expert Comment

by:Bridge
Comment Utility
OnInitDialog is added throu class wizard as WM_INITDIALOG
0
 

Author Comment

by:appleby
Comment Utility
This doesn't explain why what you suggest would work, and it is a hack more than an answer unless you explain why it is the right way to do it.  I'm only grading this rather than rejecting your answer because I would otherwise withdraw the question...I've found an entirely different way to solve my problem and don't think I will ever get a good answer to doing it this way (I've asked several places and searched everywhere.)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 88
Generic progress indicator 6 109
deburging in oracle form 12 76
has22 challenge 11 70
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now