Jump to content

Programs running in compatibily mode


 Share

Recommended Posts

I have a script to load certain files into a program, process them, and go on with the next file.

The script worked fine on Windows XP, so yesterday I tried running it on Windows 7, but it gets stuck pretty early. After some testing I think I found the problem. When sending keystrokes, mouseclicks or menuactions to a program which runs in compatibility mode, they just don't seem to be delivered. I tried a simple script for an editor (geany):

Opt("WinTitleMatchMode", 2)
$title = "Geany"
WinWait($title)
WinActivate($title)
Sleep(500)
Send("test")

If the editor runs normally, it works fine; if it runs in compatibility mode, the window gets activated, but I get no text. Problem is, the original program has to run in compatibility mode.

I searched in the forum, but couldn't find anything. Has anyone experienced a similar problem or has some ideas how to solve this?

Link to comment
Share on other sites

If someone has the same problem, I just found a workaround:

Starting the program in the AutoIt script and then running the script in compatibility mode - and voila, they are both in the same virtual machine (or whatever it is that is done) and all keystrokes are delivered

Link to comment
Share on other sites

If someone has the same problem, I just found a workaround:

Starting the program in the AutoIt script and then running the script in compatibility mode - and voila, they are both in the same virtual machine (or whatever it is that is done) and all keystrokes are delivered

If you run your script with the #RequireAdmin directive it will also be able to successfully interact with a program running in compatibility mode.

Or if a program is started in compatibility mode, and then your script is started also in compatibility mode, your script can interact with the program.

Or, do as you did :(

It has to do with the fact that any program run in compatibility mode in Win 7 runs with elevated user permissions (that's why you always get a UAC prompt when starting one).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...