Board index » cppbuilder » Two forms talking
Tony Barton
![]() CBuilder Developer |
Tony Barton
![]() CBuilder Developer |
Two forms talking2005-07-16 05:18:56 PM cppbuilder95 I need to make an MDIChild window talk to its MDIForm. Specifically, I need to be able to have a child window tell it's parent to create a new child window. Any one have any idea how to go about doing this? |
Vladimir Stefanovic
![]() CBuilder Developer |
2005-07-16 06:34:57 PM
Re:Two forms talkingQuoteSpecifically, I need to be able to have a child window tell One way could be sending custom message to MainForm's WndProc(). --- MDI Child --- // ... SendMessage( Form1->Handle, MY_CREATE_NEW_FORM, 0, 0 ); // ... --- MDI Form ( *.h ) --- // ... void __fastcall WndProc( TMessage & ) // ... --- MDI Form ( *.cpp ) --- // ... #define MY_CREATE_NEW_FORM (WM_USER + 1000) // ... void __fastcall TForm1::WndProc( TMessage &Msg ) { switch ( Msg.Msg ) { case MY_CREATE_NEW_FORM: // Your New Form Creation code ... break; // ... } TForm::WndProc( Msg ); } -- Best regards, Vladimir Stefanovic |
JD
![]() CBuilder Developer |
2005-07-16 06:48:44 PM
Re:Two forms talking
"Vladimir Stefanovic" < XXXX@XXXXX.COM >wrote:
Quote
Quotevoid __fastcall TForm1::WndProc( TMessage &Msg ) ~ JD {smallsort} |