By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

window size

P: n/a
Hi,

I want to launch Access project and want to control the position and the
size of the window.
My logic below positions Access window at upper left corner in minimized
size.

************************************************** *****
Private Sub btnLaunch_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLaunch.Click
AccApp = New Access.Application
AccApp.OpenAccessProject("C:\test\test.adp")

AccApp.Visible = True

Dim rtVal As Long
Dim hwndP As Long

hwndP = AccApp.hWndAccessApp()
rtVal = MoveWindow(hwndP, 0, 0, 850, 500, 1)
End Sub
************************************************** *****

I also tried the logic below.
This one opens the project in the way its was opened previously. That is to
say [MoveWindow] ( [FindWindow] also ) is not effective at all.

Please help.
Thank you

************************************************** *****
Private Sub btnAccess_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAccess.Click
Dim ProcID As Integer
Dim rtVal As Long
Dim hwndP As Long

ProcID = Shell("C:\Program Files\Microsoft
Office\OFFICE11\MSACCESS.EXE C:\test\test.adp", AppWinStyle.NormalFocus,
False)
hwndP = FindWindow("OMain", 0)
If hwndP = 0 Then
Exit Sub
Else
rtVal = MoveWindow(hwndP, 0, 0, 240, 320, 1)
End If
End Sub
************************************************** *****
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.