tags:

views:

83

answers:

2

On Windows/.NET can you think of a way of somehow launching an existing application in the background so the user can not see it but I can interact with it with regular API calls (clicking buttons and such)?

This would come in really useful for "wrapping" old applications that I cannot modify.

A: 

You can use srvany to run a non-service windows application as service without any programming.

Andrey Shvydky
+1  A: 

Well, you can do this sort of thing in VB... I doubt you'd have any trouble translating it to C#:

Dim p As New Process
With p

    .StartInfo = New ProcessStartInfo
    .StartInfo.UseShellExecute = True
    .StartInfo.WorkingDirectory = someFolder
    .StartInfo.WindowStyle = ProcessWindowStyle.Hidden
    .StartInfo.FileName = someExeName
    .Start()

End With

You can do all sorts of things with the process, once you have a reference to it. Not sure about the API interaction, but HTH anyway.

ChrisA
Thanks, I was expecting WinAPI backflips and overlooking this simple solution.
Tiberiu Ana