ACC: How to Position Microsoft Access on the ScreenID: Q95934
|
Advanced: Requires expert coding, interoperability, and multiuser skills.
To position Microsoft Access on the screen, you need to call the
SetWindowPos() Windows API function. The article gives a brief
demonstration of how to position Microsoft Access on the screen.
To position Microsoft Access on the screen, you will need to use the
SetWindowPos() application programming interface (API) function included in
the USER.EXE dynamic link library (DLL) included with Windows. Implement
this function as follows:
'====================================
' Global Declarations
'====================================
Option Compare Database
Option Explicit
Declare Function FindWindow% Lib "user" (ByVal lpClassName As Any,_
ByVal lpCaption As Any)
Declare Sub SetWindowPos Lib "User" (ByVal hWnd%,_
ByVal hWndInsertAfter%, ByVal X%, ByVal Y%,_
ByVal cx%, ByVal cy%, ByVal wFlags%)
'Inserts the window to precede the position window in the Z-Order.
'This parameter must be a window handle or one of the following
'constants.
Global Const HWND_TOP = 0
'Values for wFlags%.
Global Const SWP_NOZORDER = &H4 'Ignores the hWndInsertAfter.
Function SizeAccess ()
Dim cX%, cY%, cHeight%, cWidth%, h%
'Get handle to Microsoft Access.
h% = FindWindow("Omain", 0&)
cX% = 0
cY% = 0
cWidth% = 640
cHeight% = 480
'Position Microsoft Access.
SetWindowPos h%, HWND_TOP, cX%, cY%, cWidth%, cHeight%,_
SWP_NOZORDER
End Function
For an example of how to position Microsoft Access on the screen in
Microsoft Access for Windows 95 version 7.0, please see the following
article in the Microsoft Knowledge Base:
Q148856 ACC: How to Position Microsoft Access on the Screen (95/97)
Additional query words: resize size
Keywords : kbprg
Version : 1.0 1.1 2.0
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: March 18, 1999