minimize access window

NigelShaw

Registered User.
Local time
Today, 19:03
Joined
Jan 11, 2008
Messages
1,575
Hi,

can you minimize the actual db window instead of the forms? i need my db to open every time without being maximized to the screen on startup.

After this, my db will be opened full screen but its the initial suppression i need.

its for a splash screen i have put together and i will post it here whe nit is finished :)

Regs,


Nigel
 
You can move the window off screen completely, but then anytime your forms open up if they are set to center they will be lined up against the side of the screen the window has been moved off of.

Or you can hide the screen, hiding the screen would require you to set all your forms properties to Pop Up and Modal.

This is the code I use, pulled from another post on this forum (aka search function).

Code:
Option Compare Database
Option Explicit

Public Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Public Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Public Const SW_HIDE = 0
Public Const SW_NORMAL = 1
Public Const SW_MIN = 2
Public Const SW_MAX = 3


Public Const SM_CXSCREEN = 0 'X Size of screen
Public Const SM_CYSCREEN = 1 'Y Size of Screen
Function MaximizeAccess()
      ShowWindow Application.hWndAccessApp, SW_MAX
End Function
Function ShowAccess()
      ShowWindow Application.hWndAccessApp, SW_NORMAL
End Function

Function HideAccess()
      ShowWindow Application.hWndAccessApp, SW_HIDE
End Function

Public Function AdjstAccssWndw(Optional ByVal MyX As Long = 200, Optional ByVal MyY As Long = 25)
    Dim ErrNum As Long, ErrDesc As String
    On Error GoTo SubEx
    Call MoveWindow(Application.hWndAccessApp, CLng(Round((GetSystemMetrics(SM_CXSCREEN) - MyX) / 2, 0)), CLng(Round((GetSystemMetrics(SM_CYSCREEN) - MyY) / 2, 0)), MyX, MyY, True)
ExitMe:
    Exit Function
SubEx:
    ErrNum = Err.Number: ErrDesc = Err.Description: Err.Clear
    Debug.Print ErrNum & ErrDesc
    Resume ExitMe
End Function
 
Hi,

Figured it out

DoCmd.RunCommand acCmdAppMinimize

&

DoCmd.RunCommand acCmdAppMaximize

to get it back

:)


Nigel
 
Since you want this just for your splash screen, you can minimize the app window by using

DoCmd.RunCommand acCmdAppMinimize

And your splash will have to be set as POPUP (doesn't have to be modal though).
 
Hi

is there any way to suppress the db window initially when opened?
The main window opens then closes fir the popup.

Is there by chance a command that can be placed on the shortcut to keep it minimized?

I guess the db doesn't go straight away as there is a lot of data being loaded but as a plan B, would it work with a smaller dedicated db controlling only the splash so it opens, minimizes, shows splash, opens main db and closes splash or is that a dead end plan?

I would have thought that splash screens would be a bigger player in application production personally.

If I can get it working, I integrated the transparent form api to make it look more proffesional with color selector for development and lots of other features.


Regs


Nigel
 
Nope, as far as I know the database window will come up right away and then hide. Not much you can do about that (unless someone else knows of something I haven't seen).
 
Only flippin done it............

with a bit of code to minimize & maximize the window-

1. create shortcut
2. select properties
3. change "Run" to minimized ( this opens without window )
4. splash screen starts as popup and is visible :)
5. splash closes, opens mainform, mainform runs maximize code and hey presto!!

ill sort out a demo now


Nigel
 

Users who are viewing this thread

Back
Top Bottom