Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Why system send WM_SHOWWINDOW message?

$
0
0

I have two forms: Form1, Form2 (Form2 is MDI Parent Form).

I set MidParent of Form1 to Form2.

Form1.CreateParams.Style property is WS_TABSTOP|WS_MINIMIZEBOX|WS_THICKFRAME|WS_SYSMENU|WS_DLGFRAME|

WS_BORDER|WS_CLIPCHILDREN|WS_CHILD|WS_CLIPSIBLINGS ( = 1187971072).

When I create handle of Form1 (Form1.Createhandle) system send WM_SHOWWINDOW message to show Form1.

Question: Why Form1.CreateParams.Style property do not include WS_VISIBLE, system still send WM_SHOWWINDOW message?

Reference link:

"If a window has the WS_VISIBLE style when it is created, the window receives this message after it is created"

https://msdn.microsoft.com/en-us/library/windows/desktop/ms632645%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

Reference code:

publicpartialclassForm2:Form

   {

       Form1 frm1;

       publicForm2()

       {

           InitializeComponent();

            frm1=newForm1();

       }

       privatevoid button2_Click(object sender,EventArgs e)

       {

            frm1.MdiParent=this;

            frm1.InternalResize();

       }

   }

publicpartialclassForm1:Form

   {

       publicForm1()

       {

           InitializeComponent();

       }

       publicvoidInternalResize()

       {

           this.CreateHandle();

       }

   }

 

Topic related:

https://social.msdn.microsoft.com/Forums/windows/en-US/fedd1949-b8e7-4632-b259-9882ceffb4af/visible-property-of-form-is-set-automatically-to-true?forum=winforms


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>