change the size and position of an application

E.g
Private Sub Command1_Click()
   shell("c:\winnt\application.exe,3)
   ' Here do I want to change the size and postition of the applications window
Is this possible to do that ?
Note: The application is not a VB projekt

FreddeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MitchBroadheadCommented:
what is the application?  Can you use:
Set App = new Application
after adding relevant object library?
0
vbWayneCommented:

'here is everyth9ing you need...you just have to
'apply it to your situtation
'specify the screen size/position of a window
'this example sets notepad to the bottom left corner

Private Type POINTAPI
    X As Long
    Y As Long
End Type

Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type

Private Type WINDOWPLACEMENT
        Length As Long
        flags As Long
        showCmd As Long
        ptMinPosition As POINTAPI
        ptMaxPosition As POINTAPI
        rcNormalPosition As RECT
End Type

Private Declare Function SetWindowPlacement _
Lib "user32" (ByVal hwnd As Long, _
lpwndpl As WINDOWPLACEMENT) As Long

Private Declare Function GetWindowPlacement _
Lib "user32" (ByVal hwnd As Long, lpwndpl As _
WINDOWPLACEMENT) As Long

Private Declare Function FindWindow Lib _
"user32" Alias "FindWindowA" (ByVal lpClassName _
As String, ByVal lpWindowName As String) As Long

Private Declare Function SetRect Lib "user32" _
(lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, _
ByVal X2 As Long, ByVal Y2 As Long) As Long

'==========================================
'this is in the for
'calls notepad and opens a file as t sets it's place and position.

Private Sub Command1_Click()
   Dim WndPlace As WINDOWPLACEMENT
   Dim h As Long
    Dim RetVal
    RetVal = Shell("C:\WINDOWS\notepad.exe C:\A VB Tips\alpha only.txt", 1)
    'Shell "Notepad", vbHide
    h = FindWindow("Notepad", vbNullString)
    If h <> 0 Then
        WndPlace.Length = Len(WndPlace)
        Call GetWindowPlacement(h, WndPlace)
        Call SetRect(WndPlace.rcNormalPosition, 0, 3700, WndPlace.rcNormalPosition.Right, 4000)
        Call SetWindowPlacement(h, WndPlace)
    End If
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FreddeAuthor Commented:
Is only working with notepad ? I get h =0 when I tried another program
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.