Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Resize the MDI window

Posted on 1998-12-21
4
Medium Priority
?
275 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 600 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

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Suggested Courses

916 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