Solved

Resize the MDI window

Posted on 1998-12-21
4
242 Views
Last Modified: 2012-06-21
I am trying to find a way to use API calls (or something easier!) that will allow me to resize and possibly move the main window of Access while the app is running.  Any help?
0
Comment
Question by:dexweaver
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
Sendoh earned 200 total points
ID: 1971745
Hi !

The code as follow :

Option Compare Database
Option Explicit

Public Const HWND_TOP = 0
Public Const SWP_SHOWWINDOW = &H40

Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type

Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Function setSizeAccess() As Boolean
    Dim rc As RECT
   
    GetWindowRect Application.hWndAccessApp, rc
    MsgBox "left = " & rc.Left & Chr(13) & _
            "right = " & rc.Right & Chr(13) & _
            "top = " & rc.Top & Chr(13) & _
            "bottom = " & rc.Bottom & Chr(13)
    msgbox SetWindowPos(Application.hWndAccessApp, HWND_TOP, _
            rc.Left, rc.Top, (rc.Right - rc.Left)+100,
(rc.Bottom - rc.top) + 100, SWP_SHOWWINDOW)
End Function

0
 
LVL 5

Expert Comment

by:kulikuli
ID: 1971746
If I am correct you should flip the sides you are summing:
(rc.Right - rc.Left) should be (rc.left-rc.right)
(rc.Bottom - rc.top) should be (rc.top - rc.bottom)

Right?
0
 
LVL 1

Author Comment

by:dexweaver
ID: 1971747
It will take me till after the holidays to evaluate your answer, sendoh.  I appreciate your response!!
0
 
LVL 1

Author Comment

by:dexweaver
ID: 1971748
I lied.  I couldn't wait to evaluate it.  I'm like a kid in a candy store with that function!  10q very much.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question