Application Window

L

Luke Bellamy

Hi - how can I change the position, height, and width of the
main parent Access application window?

Thankyou
 
A

Arvin Meyer

Luke Bellamy said:
Hi - how can I change the position, height, and width of the
main parent Access application window?

Dev Ashish wrote this code:

'********* Code Start **********
Private Type RECT ' 16 Bytes
left As Long
top As Long
right As Long
bottom As Long
End Type

Private Declare Function apiMoveWindow Lib "user32" _
Alias "MoveWindow" _
(ByVal hWnd As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal bRepaint As Long) _
As Long

Private Declare Function apiGetWindowRect Lib "user32" _
Alias "GetWindowRect" _
(ByVal hWnd As Long, _
lpRect As RECT) _
As Long

Sub sMoveAccessWindow()
Dim tRect As RECT
Call apiGetWindowRect(hWndAccessApp, tRect)
With tRect
Call apiMoveWindow(hWndAccessApp, 200, 200, _
.right + .left, .bottom + .top, True)
End With
End Sub
'********** Code End ************
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top