Solved

Resize the MDI window

Posted on 1998-12-21
4
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

636 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