• Minimize DB (Access 2000)

    Author
    Topic
    #373742

    Is there anyway to have the main database window minimize or resized to the size of a startup form?

    Viewing 0 reply threads
    Author
    Replies
    • #601750

      If you want to minimize the Access application window to the taskbar, you need some Windows API stuff to do that:

      Public Type Rect
      X1 As Long
      Y1 As Long
      X2 As Long
      Y2 As Long
      End Type

      Public Type PointAPI
      x As Long
      y As Long
      End Type

      Public Type WindowPlacement
      Length As Long
      Flags As Long
      showCmd As Long
      ptMinPosition As PointAPI
      ptMaxPosition As PointAPI
      rcNormalPosition As Rect
      End Type

      Public Declare Function GetWindowPlacement Lib “user32” _
      (ByVal hWnd As Long, lpWndPl As WindowPlacement) As Long

      Public Declare Function SetWindowPlacement Lib “user32” _
      (ByVal hWnd As Long, lpWndPl As WindowPlacement) As Long

      Public Const SW_Maximize = 3
      Public Const SW_Minimize = 6
      Public Const SW_Restore = 9

      Public Sub AccessWindow(sw As Long)
      Dim wp As WindowPlacement
      GetWindowPlacement Application.hWndAccessApp, wp
      wp.showCmd = sw
      SetWindowPlacement Application.hWndAccessApp, wp
      End Sub

      To minimize the Access window, use

      AccessWindow SW_Minimize

      I don’t know how to shrink the Access window so that a form fits precisely in the client area. Perhaps somebody else can help there.

      • #601752

        Thanks, I tried this technique earlier, however I am searching for a way to shrink the Access window so that a form (which is a pop-up) fits exactly in the client area.

        • #601879

          Why not just maximize the startup form?

          • #601926

            It is a small 3″ x 3″ popup form. It would be nice not to see the Access application window behind it if possible.

            • #601980

              Well, there are a few tricks to accomplish this. The only one I remember at the moment is to reduce the height of the main window manually and then drag it off the screen before closing the database. If your startup form is a popup, it will popup on the screen the next time you open the database, but the main window will remain where you placed it. Position the startup form where you want it to appear and close the db again. If you play with it a bit, you can make it work. I’ve never even attempted to do this from code so I don’t know if it can be done that way.

              There’s another method that involves reducing the main window and hiding it behind the popup form, but I don’t recall the specific ins and outs of it. It should be similar to the method I described above though.

    Viewing 0 reply threads
    Reply To: Minimize DB (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: