I have a mdi app which uses an icon I put in the sys tray.
When I double click on the icon (and the app is minimized) the app is maximized and a child form is opened. This works ok.
If I double click on the icon (and the app is in any state) the app should appear and the child form should either be loaded of have focus set to it. This does not work. The mdi form does not even appear.
Can anybody explain why and how to correct this.
VB Code:
Private Sub MDIForm_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Static lngMsg As Long Static blnFlag As Boolean Dim lngResult As Long lngMsg = X / Screen.TwipsPerPixelX If blnFlag = False Then blnFlag = True Select Case lngMsg Case WM_LBUTTONDBLCLK lngResult = SetForegroundWindow(Me.hwnd) ' Check if RATs is minimized If Me.WindowState = vbMinimized Then Me.WindowState = vbMaximized ' Check if Pinboard is open If FormIsOpen("frmRelatedItems") Then ' Check if Pinboard is minimized If frmRelatedItems.WindowState = vbMinimized Then frmRelatedItems.WindowState = vbNormal Else frmRelatedItems.SetFocus End If Else Load frmRelatedItems End If End Select blnFlag = False End If End Sub





Reply With Quote