Page 1 of 1

Script only works when app started with RunApplication

Posted: Thu Mar 08, 2012 2:04 am
by maxxxx
Hi,
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);
			}
		}


Re: Script only works when app started with RunApplication

Posted: Fri Mar 09, 2012 2:11 pm
by Support Team
Hi,

It seems that there are some security problems, so please try to start everything as administrator (with the same security rights) and make sure that all files are located on a local drive and not on a network one.
You can also try to disable the UAC.

Regards,
Markus
Ranorex Support Team