Print Page | Close Window

MDI Minimize to tray issue

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=14204
Printed Date: 07 October 2024 at 12:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MDI Minimize to tray issue
Posted By: JvdH
Subject: MDI Minimize to tray issue
Date Posted: 03 May 2009 at 3:55pm
Hello folks,
 
When I try to minimize a ribbon by clicking the the close button on the parent form it automatically closes the subforms for some reason.
 
The unload code on the parent is:
Public Sub MDIForm_Unload(Cancel As Integer)
On Error Resume Next
Dim sMainCloseButtonFunction As Integer
    sMainCloseButtonFunction = ReadINIFile(App.Path & "\Preferences.ini", "Settings", "MainCloseButtonFunction", "")
    If sMainCloseButtonFunction = 1 Then
        Cancel = True
        Call MinimizeToTray
        Exit Sub
    Else
        mWidth = Me.Width
        mHeight = Me.Height
        SaveSetting App.Title, "Settings", "Width", mWidth
        SaveSetting App.Title, "Settings", "Height", mHeight
        Call SetWindowLong(Me.hwnd, GWL_WNDPROC, OldWindowProc) 'unload resize form
        Unload Me: End
    End If
End Sub
 
The minimze code:
Public Sub MinimizeToTray()
    If Not Minimized Then
        TI.MinimizeToTray Me.hwnd
        Minimized = True
        CommandBars.RecalcLayout
    Else
        TI.MaximizeFromTray Me.hwnd
        Minimized = False
        CommandBars.RecalcLayout
    End If
End Sub
 
And when I call the MinimizeToTray function via a Button it works fine.
Is this a bug or am I missing a piece of code or?


-------------
Product: Xtreme SuitePro (ActiveX) version 13.2.1
Platform: Windows 7 (64bit)
Language: Visual Basic 6.0 SP6



Replies:
Posted By: jpbro
Date Posted: 03 May 2009 at 10:02pm
Maybe try the QueryUnload event instead (test the UnloadMode parameter for vbFormControlMenu and then run your minimize code)?



-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net