Msced cannot see program running in compatability mode

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
dbish1
Newbie
Posts: 4
Joined: Sun May 29, 2022 1:12 am

Msced cannot see program running in compatability mode

Post by dbish1 » Sun May 29, 2022 5:48 am

I have a strange one here.

I am still using Macro Scheduler ver 7 and have had it for close to 20 years. I have written a lot of scripts. Most of my scripts are simple "Open program/setfocus/press this/send that" type of code. I just began having problems with one specific program and series of macros that I have successfully used for over 15 years.

Last Thursday at 3 p.m. I had an automated script run TRX for Windows, a portfolio management tracking program (actual exe called trxwin32.exe). Successfully completed. Then, 4 hours later I clicked the program to open (no macros involved) and I received an "Exception EAccessViolation in module Trxwin32.exe at . . ." I tried a lot of different appoaches to fixing the AccessViolation problem and finally had to run the program in compatibility mode (did no matter whether it was compatible with Win98, Vista,Win7, or Win 8 and whether Run as Administrator was on or off - If some kind of compatibility was checked the program would run). Okay - moving on.

Now, when i run Macro Scheduler scripts it is as if the TRX program does not exist and the macro terminates. As an example: I formerly used the command:
Let>RP_WINDOWMODE=3
Run Program>c:\path\trxwin32.exe
Now that fails with a macros Scheduler error "Error Executing c:\path\Trxwin32.exe (0).

If I instead use the command:
Let>RP_WINDOWMODE=3
ExecuteFile>c:\path\trxwin32.exe
I can get my program to open but not in a maximized condition.

If I used the shortcut which also specified Maximize:
Executefile>C:\Users\Dave\AppData\Roaming\Microsoft\Windows\Start Menu\TRX for Windows.lnk
the program would open maximized.

Now for the really strange stuff. My macros usually do things like click File menu in toolbar, select export ticker symbols to a file, and save that file. In code it looks like this (I took out all the Wait>.5 commands to save space):
SetFocus>TRX for Windows*
Press ALT
Send>f
Release ALT
Send>b [Note: this opens file save as box]
PutClipboard>D:\My Documents\Excel\Asset Management\TRX_Symbols.txt
Press CTRL
Send>v
Release CTRL
Press ALT
Send>s [Note: this says to save file]
Release ALT
Wait>2
SetFocus>Confirm*
Press Left
Press Enter
The macro failed on the first line - SetFocus. It is if msched cannot see the program (because it is running in compatabilty mode??). The macro error-ed out when it tried to look for the file save confirmation which never happens.

I tried testing a simple code on this program that I had opened manually (the program functions fine when used manually)
SetFocus>TRX for Windows*
Wait>1
MouseMove>1540,193
Wait>1
Press LClick
When run with a minimized TRX program the program is never brought to the focus. If the program is already maximized and visible on screen the mouse never moves and the LClick never happens. I then tried the same test substituting a browser page on the screen and in the code - msched worked fine.

MSCHED only seems to be failing on this one program which is in compatibility mode. I have reinstalled the underlying program with no improvement. I have fully tested memory modules, malware, sfc, dsim and Data Execution Protection techniques to allow the program to run in normal mode like it has for 20 years. I have not been able to get that to work.

I wonder whether my error falls into the visible/hidden world of parent and child windows. Task manager tells me that the underlying program is runnig as a normal process (not hidden) for what that is worth.

Any ideas?

Thanks

Dave

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Msced cannot see program running in compatability mode

Post by Grovkillen » Sun May 29, 2022 6:21 pm

I think you need to compile another exe and test if the set focus is the culprit here.
Let>ME=%Script%

Running: 15.0.24
version history

dbish1
Newbie
Posts: 4
Joined: Sun May 29, 2022 1:12 am

Re: Msced cannot see program running in compatability mode

Post by dbish1 » Mon May 30, 2022 8:59 pm

This is not a compiled script - I run it through the macro Scheduler quick start function.

I am not sure where Macro Scheduler looks for running windows. I looked at the Macro Scheduler/View system windows applet and I can see the TRX program and subsidiary entries - yet SetFocus does not see it.

ocnuybear
Pro Scripter
Posts: 100
Joined: Sun Jul 15, 2018 5:14 pm

Re: Msced cannot see program running in compatability mode

Post by ocnuybear » Tue May 31, 2022 1:06 pm

Have you tried reinstalling MS?
Some scripts of mine stopped working & after reinstalling the problem was fixed.

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Msced cannot see program running in compatability mode

Post by JRL » Wed Jun 01, 2022 1:32 pm

Just a thought.
You may be using 20 year old Macro Scheduler but from the path you supplied:
C:\Users\Dave\AppData\Roaming\Microsoft\Windows\Start Menu\TRX for Windows.lnk
You are using an up to date operating system. Windows Defender has been killing some, not all, of my executables. Phil Pendlebury has been reporting similar issues. I can't turn mine off, group policy will just turn it back on. The "solution" is to register (not sure that's the correct term) your executables with Microsoft. That's never gonna happen. Macro Scheduler is registered software so the malware defenders leave it alone. All that said to ask, have you tried removing malware software from your computer? I would not be surprised to hear Macro Scheduler version 7 is just too old to still be protected from the gremlins protecting us from the other gremlins invading us.

dbish1
Newbie
Posts: 4
Joined: Sun May 29, 2022 1:12 am

Re: Msced cannot see program running in compatability mode

Post by dbish1 » Wed Jun 01, 2022 2:31 pm

I will try reinstalling MS. I reinstalled the problem program (TRX) without any improvement.

Regarding the questions on age of MS vs new operating systems - the thing I cannot figure out is why this system worked fine at 3 pm Thursday after working find for 15 years. Nothing changed on computer (ie Windows update./install new software, etc). Then when I used underlying software at 7 pm same day the underlying program would only run in compatibility mode and MS fails on SetFocus. I have no explanation and have not found any other theories.

Thanks for the suggestions.

Dave

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Msced cannot see program running in compatability mode

Post by JRL » Wed Jun 01, 2022 3:17 pm

Dave,
I understand your confusion. I'm still perplexed. In my world I can now get some updates silently and not know they have occurred so I can't tell you that no updates happened. What I can state is that I've had executables that had been humming along nicely for years and suddenly stopped working. In March of this year I had a period of time where executables were self deleting. Schedules and shortcuts would suddenly report "file not found" and sure enough the files were gone. Recreating an affected executable (using v14) then running it manually... you could watch the file not perform any of its directed activities and vanish from Windows File Explorer. Not all, only a few of my executables did that and it seems they are no longer performing this disappearing miracle.

I would still suggest downloading the latest Macro Scheduler as a trial version just to see if it makes a difference. Otherwise, based on my experience with executables give it a week and all will likely suddenly go back to normal.

dbish1
Newbie
Posts: 4
Joined: Sun May 29, 2022 1:12 am

Re: Msced cannot see program running in compatability mode

Post by dbish1 » Thu Jun 02, 2022 6:23 am

I did a reinstall of MS ver 7.4 and you were right - it worked better (if not totally). There are still some weird hickups. Win10/11 wants to put the scp files in users/dave/appdata/local/virtual store/prog (x86)/macro scheduler. I had the scripts in c:\prog (x86)/macro scheduler originally. Now, all the changes I have made to my macros (which Win 10 saves in in users/appdata) continue to screw up but if I run a script from the MS quick launch it seems to look in the c:/prog files location and is working. I do not know why win 10 moves everything to users directory but it was never a concern until this problem.

I will continue to plug away at this but I see potential workarounds. Very annoying - I thought I solved these problems 15 years ago!

Thanks to everyone for their posts.

Dave

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts