I am automating a .NET 2 app on Windows 7 64-bit.
When I start my app with Host.Local.RunApplication everything works great.
When I start my app from Explorer and then find the window with FindChild the window gets found and I can retrieve the correct screen dimensions but calls to Move or other functions have no effect.
Here is the code I am using:
//starts the app
Code: Select all
private void cmdInit_Click(object sender, RoutedEventArgs e)
{
Host.Local.RunApplication(@"C:\MyApp.exe");
}
//finds the window and moves it
//move will fail if cmdInit_Click hasn't been run
private void cmdFindWindow_Click(object sender, RoutedEventArgs e)
{
mGuideWindow = Host.Local.FindChild<Ranorex.Form>("My app");
if (mGuideWindow != null)
{
var cur = mGuideWindow.ScreenRectangle;
mGuideWindow.Move(3500, cur.Y);
}
}