Solved

PreCreateWindow() not getting hit in a Dialog

Posted on 1998-12-02
4
648 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
ID: 1325630
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
ID: 1325631
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
ID: 1325632
OnInitDialog is added throu class wizard as WM_INITDIALOG
0
 

Author Comment

by:appleby
ID: 1325633
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need a Shell script to start a service checking the port 6 55
MFC Dialog 9 52
Replacement selected text 2 65
List out all word 7 332
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 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