Script only works when app started with RunApplication

Ask general questions here.
maxxxx
Posts: 1
Joined: Thu Mar 08, 2012 1:56 am

Script only works when app started with RunApplication

Post by maxxxx » Thu Mar 08, 2012 2:04 am

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);
			}
		}


User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Script only works when app started with RunApplication

Post by Support Team » Fri Mar 09, 2012 2:11 pm

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
.
Image