Hide Close, Minimize and Maximize at top of access window 
Author Message
 Hide Close, Minimize and Maximize at top of access window

I cant find in access anywhere how to hide the controls at the top of th
access window, anyone know of a way to do this in VBA

any help well appreciated

Jon



Sun, 07 Apr 2002 03:00:00 GMT  
 Hide Close, Minimize and Maximize at top of access window
Yeah, you hide the Access Window, and you won't see those buttons,
can't use them either!!!  Here's the code to do so:

'Just place the following lines in a new module:
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As
Long) As Long
Dim dwReturn As Long

Const SW_ShowMaximize = 3
Const SW_HIDE = 0
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
     ByVal nCmdShow As Long) As Long

Public Function fAccessWindow(Procedure As String, SwitchStatus As
Boolean, StatusCheck As Boolean) As Boolean
If SwitchStatus = False Then
    If Procedure = "Hide" Then
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
    End If
    If Procedure = "Show" Then
        dwReturn = ShowWindow(Application.hWndAccessApp,
SW_ShowMaximize)
    End If
End If
If SwitchStatus = True And StatusCheck = False Then
    If IsWindowVisible(hWndAccessApp) = 1 Then
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
    Else
        dwReturn = ShowWindow(Application.hWndAccessApp,
SW_ShowMaximize)
    End If
End If
If StatusCheck = True Then
    If IsWindowVisible(hWndAccessApp) = 0 Then
        fAccessWindow = False
    End If
    If IsWindowVisible(hWndAccessApp) = 1 Then
        fAccessWindow = True
    End If
End If
End Function

'that's  a modified version of the code off of Dev Ashish's site.  It
only has two constants set, hide which is 0 and maximize which is 3,
which is all I use, but if you get the code from his site, you can
minimize too, and I think one other option is available.

Then to use this function there are several options.
If you just want to hide the access window, type this in the line of
code:
Call fAccessWindow("Hide",False,False)
- or to show the access window -
Call fAccessWindow("Show",False,False)

Now if you just want to Reverse the current setting, so if it's hidden
you just want to make it visible, or vice versa (this way it will just
switch it.) then use this:
Call fAccessWindow("",True,False)

Now if you want to know if Access is hidden or not, for example, my
Master Editing Menu has a button that runs this code, and when that
form opens up, the On Open event changes the Icon on that button, on
whether the Access window is hidden or not(Sorta like an Lighted Toggle
switch that lights up when the controled object is turned on!) then use
this statement, and just replace True with False, if you want to detect
if the Access Window is Hidden:
If fAccessWindow("",False,True)=True Then
     'Do whatever
End If

Hope that helps!

Crying Wolf



Quote:
> I cant find in access anywhere how to hide the controls at the top of
th
> access window, anyone know of a way to do this in VBA

> any help well appreciated

> Jon

--
He who learns but does not think is lost, he who thinks but does not lea

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 07 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. API for hide the icons of maximize, minimize and close the window

2. How to hide the minimize, restore and close button on a maximized form

3. Visual Basic - Trapping Minimize/Maximize/Close Events (from the window's buttons)

4. Using VBScript to minimize, restore/maximize, close window

5. Using VBScript to minimize, restore/maximize or close a window

6. Window without maximize-, minimize- and close-button needed

7. How to hide the maximize/restore and close-button on a maximized form

8. CoolHide - Help you hide/minimize window to Tray and hide icons from the system tray

9. CoolHide - Help you hide/minimize window to Tray and hide icons from the system tray

10. Word 2000 minimize, maximize, close buttons

11. minimize/maximize/close

12. enable/disable minimize/maximize/close

 

 
Powered by phpBB® Forum Software