Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - MDI Minimize to tray issue
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MDI Minimize to tray issue

 Post Reply Post Reply
Author
Message
JvdH View Drop Down
Groupie
Groupie


Joined: 09 May 2008
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote JvdH Quote  Post ReplyReply Direct Link To This Post Topic: MDI Minimize to tray issue
    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
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.