Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5

    Unanswered: Sample Data BAse for Hiding Access and rounding buttons

    Someone pointed me in the direction of a sample mdbthat hadome really cool api calls for access, like hiding the window to look like a standard application, and rounding buttons and translucent forms - any help in pointing me to thaT WOULD BE GREAT
    Dale Houston, TX

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Here's the code of a module that allows to hide the Access environment:
    Code:
    Option Compare Database
    Option Explicit
    
    Global Const SW_HIDE = 0
    Global Const SW_SHOWNORMAL = 1
    Global Const SW_SHOWMINIMIZED = 2
    Global Const SW_SHOWMAXIMIZED = 3
    
    Private Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal CmdShow As Long) As Long
    
    Function SetAccessWindow(CmdShow As Long)
    
    ' Purpose: Totally hide Access.
    '
    ' Call the function with: Call SetAccessWindow(0).
    '
    ' Warning: Don't try setting a breakpoint or stopping the
    ' -------  execution of the code in there --> Access crash.
        
        Dim lngResult As Long
        Dim frmCurrent As Form
        
        On Error Resume Next
        Set frmCurrent = Screen.ActiveForm
        If Err <> 0 Then
            lngResult = apiShowWindow(hWndAccessApp, CmdShow)
            Err.Clear
        End If
        If CmdShow = SW_SHOWMINIMIZED And frmCurrent.Modal = True Then
            MsgBox "Cannot minimize Access with " & frmCurrent.Caption & " form on screen"
        ElseIf CmdShow = SW_HIDE And frmCurrent.PopUp <> True Then
            MsgBox "Cannot hide Access with " & frmCurrent.Caption & " form on screen"
        Else
            lngResult = apiShowWindow(hWndAccessApp, CmdShow)
        End If
        SetAccessWindow = (lngResult <> 0)
        
    End Function
    Changing the shape of a form is rather easy too, but I don't know how to easily change the shape of a control (such as a CommandButton) on a form.
    Have a nice day!

  3. #3
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    I am trying to hide tyhe access shell while keeping a form open and visible on the desk top.
    Dale Houston, TX

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    That's precisely what the code I posted does.
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •