|
-
June 9th, 1999, 11:31 AM
#1
how to change the dialog'class name
As we know ,the default class name of Dialog box
is "Dialog",but I can not change its classname (the Dialog-based MFC programme) by changing the ''cs'' structure of PrecreateWindow function.Could you help me to solve this question?
Remember ! Your suggestion can make a difference!
Thank you!
qiyang
-
June 9th, 1999, 05:20 PM
#2
Re: how to change the dialog'class name
If PreCreateWindow is called, what you want to do must be done carefully. I don't know if you realize this, but changing the class name will not only change the name, but Windows will attempt to look for a predefined window class that has been registered using RegisterClass().
The steps required to do what you want *safely* are as follows:
1) Get the WNDCLASS structure for the window within the PreCreateWindow() function. The call to do this is GetClassInfoEx().
2) Change the class name within the returned WNDCLASS structure.
3) Register a new window class by calling RegisterClass() with the changed WNDCLASS structure.
4) You now have a dialog class that is not called "Dialog", but with your own name. Now it's your job to create windows that are of this new class.
5) Make sure that you call UnregisterClass() when the app is finished (unless you really want to do something special).
Is this what you wanted to do?
Regards,
Paul McKenzie
-
October 20th, 1999, 10:09 AM
#3
Re: how to change the dialog'class name
Thank you Paul but...
Ok I Have a wnd with the right WNDCLASS .
How can I use it as a Dialog (CDialog) with DDX/DDV ...
SubClassing ?
Making everything by myself (Dialog functionnalities)
Thank You
Michel
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
|