Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » CDialog::OnInitDialog (MFC) like method?
Re: CDialog::OnInitDialog (MFC) like method? [message #29683 is a reply to message #29681] Mon, 08 November 2010 12:21 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
alex100 wrote on Mon, 08 November 2010 05:48

Hello all
I need to customize some visual things in the main app window, like system menu and related.

If i call GetSystemMenu(GetHWND(),0) on constructor it returns null. But if i call it on a button handler it works.
It seems that system menu is not available yet during constructor.


My question is: Is there any handle/method like CDialog::OnInitDialog (VC++/MFC) where it is guaranteed that all visual controls are ready to be customized?



No.

I guess the simple approach is just to call whatever equivalent of OnInitDialog after you open the window.

If this seems too ugly (e.g. you are creating some library), you can get as close as possible to MFC by overriding WindowProc method (Win32 specific, but so is your problem). Eventually, there is even "NcCreate" virtual method that can be overriden.

Just do not forget to call "original" WindowProc / NcCreate at the end of your init code...
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem with Calendar control
Next Topic: widget or source code to handle dicom files
Goto Forum:
  


Current Time: Tue May 28 21:52:12 CEST 2024

Total time taken to generate the page: 0.01369 seconds