D
David
I'm working on an old old system that uses customized menu
bars. It is a pain because they keep popping up and
affecting my development since they replace the Access
menu bars. The Load and Unload events for my main menu are
as follows. Can anyone explain to me what they are doing?
I'd really like to get rid of the customized menu bars
completely since I have extensively modified this system
and they are now all wrong. They are maintained by global
Windows API functions which are incomprehensible to me.
Private Sub Form_Load()
On Error Resume Next
Dim intChildWindowState As Integer
intChildWindowState = GetPrivateProfileInt("Secondary
Window", "State", 0, "srts_a.ini")
If intChildWindowState = 2 Then
DoCmd.Maximize
End If
Application.MenuBar = "mcrMenuBar"
DoCmd.ShowToolbar "Form View", A_TOOLBAR_NO
DoCmd.ShowToolbar "Print Preview", A_TOOLBAR_NO
DoCmd.ShowToolbar "SRTS Print Preview", A_TOOLBAR_NO
DoCmd.ShowToolbar "SRTS", A_TOOLBAR_YES
'App3DRegister
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim intChildWindowState As Integer
Dim intReturnCode As Integer
DoCmd.ShowToolbar "SRTS", A_TOOLBAR_NO
DoCmd.ShowToolbar "Form View", A_TOOLBAR_WHERE_APPROP
DoCmd.ShowToolbar "Print Preview",
A_TOOLBAR_WHERE_APPROP
If IsZoomed(Forms!frmMain.hWnd) <> 0 Then
intChildWindowState = 2
Else
intChildWindowState = 0
End If
intReturnCode = WritePrivateProfileString("Secondary
Window", ByVal "State", ByVal Trim$(Str
(intChildWindowState)), "srts_a.ini")
'App3DUnRegister
If SysCmd(SYSCMD_RUNTIME) Then
DoCmd.Quit
End If
End Sub
bars. It is a pain because they keep popping up and
affecting my development since they replace the Access
menu bars. The Load and Unload events for my main menu are
as follows. Can anyone explain to me what they are doing?
I'd really like to get rid of the customized menu bars
completely since I have extensively modified this system
and they are now all wrong. They are maintained by global
Windows API functions which are incomprehensible to me.
Private Sub Form_Load()
On Error Resume Next
Dim intChildWindowState As Integer
intChildWindowState = GetPrivateProfileInt("Secondary
Window", "State", 0, "srts_a.ini")
If intChildWindowState = 2 Then
DoCmd.Maximize
End If
Application.MenuBar = "mcrMenuBar"
DoCmd.ShowToolbar "Form View", A_TOOLBAR_NO
DoCmd.ShowToolbar "Print Preview", A_TOOLBAR_NO
DoCmd.ShowToolbar "SRTS Print Preview", A_TOOLBAR_NO
DoCmd.ShowToolbar "SRTS", A_TOOLBAR_YES
'App3DRegister
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim intChildWindowState As Integer
Dim intReturnCode As Integer
DoCmd.ShowToolbar "SRTS", A_TOOLBAR_NO
DoCmd.ShowToolbar "Form View", A_TOOLBAR_WHERE_APPROP
DoCmd.ShowToolbar "Print Preview",
A_TOOLBAR_WHERE_APPROP
If IsZoomed(Forms!frmMain.hWnd) <> 0 Then
intChildWindowState = 2
Else
intChildWindowState = 0
End If
intReturnCode = WritePrivateProfileString("Secondary
Window", ByVal "State", ByVal Trim$(Str
(intChildWindowState)), "srts_a.ini")
'App3DUnRegister
If SysCmd(SYSCMD_RUNTIME) Then
DoCmd.Quit
End If
End Sub