I am trying to set focus to an application using AppActivate

Barleyman

Newcomer
Joined
Dec 12, 2002
Messages
1
I am trying to develop a asp.net web application using VB.net to set focus to an application and sendkeys to it. I have used the following code on Page_Load event and get the same error each time:

Exception Details: System.ArgumentException: Process 'Calculator' was not found.

Source Error:


Line 23: Dim MyAppID, ReturnValue
Line 24: ' In Microsoft Windows:
Line 25: AppActivate("Calculator") ' Activate App
Line 26:
Line 27: '' AppActivate can also use the return value of the Shell function.

Calculator is running and the Title bar is ("Calculator")

Please Help.
 
I tried the same code in the form_load event using straight vb.net and it worked fine. I don't use asp.net but a my guess would be that if this code is running on the server then it can't see the applications running on the client.
 
ASP.Net applications run under their own user account (ASPNET) and as such will not have access to applications running on the same machine under a different user account.
 
Back
Top