Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resize Access Application Window, not form

Status
Not open for further replies.

jasonphillipstx

Technical User
Dec 10, 2001
43
0
0
US
I have searched andjust cannot find the info I need. I want click a button and have access move/resize to a certian part of the screen. I tried the movesize command, but that only works for forms. Does anyone know how to do this?

thanks in advance.
 
jasonphillipstx,
Here is one way.
Code:
Public 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

Public Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, _
                                                 ByVal nCmdShow As Long) As Long


Public Function ResizeAccess()
  Dim lngReturn As Long
  Dim hWnd As Long
  
  ' get app's window handle
  hWnd = Application.hWndAccessApp
  
  ' move to upper left vorner of screen 0, 0
  ' resize app window to 800 x 600
  lngReturn = SetWindowPos(hWnd, 0, 0, 0, 800, 600, 0)
  
  ' normalize window
  lngReturn = ShowWindow(hWnd, 1)
End Function

Hope this helps,
CMP

(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top