Automating from within an application

Jul 20, 2009 at 7:46 AM
Edited Jul 20, 2009 at 7:47 AM

Is it possible to automate from within a running app, as oppsed to lauching or attaching to another app?

I have a simple WPF app, and using a static method call, I do the following:

application =

Application.Attach(System.Diagnostics.Process.GetCurrentProcess());

window = (Core.UIItems.WindowItems.Window)application.GetWindow("Window1");

 

the call to GetWindow never returns.

what am i doing wrong?

 

Jul 24, 2009 at 4:34 AM

after initialising application, try

application.ApplicationSession.Save();

and give InitializeOption.WithCache/NoCache in GetWindow function call.

Coordinator
Jul 31, 2009 at 10:16 AM

Have you tried using a different thread to execute your static method?