Click here to Skip to main content
15,919,358 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am coding an application in VB (VS-2008). It is a MDI application with one Parent form and many child forms. Child forms can be minimized but can not be Maximized.

I want to know 4 Windows messaging values.
1. What is the WM Value when a child form is shown on MDI Client Area
2. What is the WM Value when a child form is Closed/Disposed.
3. What is the WM Value when a child form is minimized.
4. What is the WM Value when a child form is normalized.

By using WinProc function I could see the Messages but could not differentiate which is for what, If any body can provide me the Window Message values i will be very thankfull.

Thanks.

K. K. Barman
kanoj.k.barman@gmail.com
8th Sep 2020

What I have tried:

VB
<system.security.permissions.permissionsetattribute(system.security.permissions.securityaction.demand, name:="FullTrust" )=""> _
       Protected Overrides Sub WndProc(ByRef m As Message)
        Dim MyRec As Integer = Me.DataGridView1.Rows.Count + 1
        Dim MyString() As String = {MyRec.ToString, m.Msg, m.WParam.ToString, m.LParam.ToString}
        Me.DataGridView1.Rows.Add(MyString)
        'RaiseEvent LBItemAdded()
        ' Listen for operating system messages
        Select Case (m.Msg)
            ' The WM_ACTIVATEAPP message occurs when the application
            ' becomes the active application or becomes inactive.
            Case WM_ACTIVATEAPP
                'MsgBox("App Active." & Chr(13) & _
                '       "Value = " & m.Msg)
                ' The WParam value identifies what is occurring.
                appActive = (m.WParam.ToInt32() <> 0)

                ' Invalidate to get new text painted.
                Me.Invalidate()

        End Select

        MyBase.WndProc(m)
    End Sub
Posted
Updated 8-Sep-20 9:16am
v2

 
Share this answer
 
Unfortunately it is not that simple. See About the Multiple Document Interface - Win32 apps | Microsoft Docs[^].
 
Share this answer
 
v2
Comments
Member 11700078 10-Sep-20 8:26am    
Dear Richard MacCutchan,

Actually it may be simple who knows about this. I did not clarify the case properly.
I have a Mdi Parent, on which a DataGridView, a MenuStrip with three buttons.
Clicking the one button loads a child form and displays. At the same time 15 Messages are written in the DGV. 77 Message is written when Parent form is displaced. When Child form loaded another 15 Messages written. i wanted to know, which message value is for Child Form Displayed. I understand that after display Child Form Active Message is also sent. Just see if any body can give any idea.

Regards.
K.K.Barman.
Richard MacCutchan 10-Sep-20 8:40am    
Well you can see why it is not simple. You need to look at each individual message in the MSDN documentation for full details of when and why they are sent.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900