Transition between programs (windows)

Announcements, general discussion
Post Reply
dkdomino
Posts: 1
Joined: 21 Apr 2017, 19:16

Transition between programs (windows)

Post by dkdomino » 21 Apr 2017, 19:34

Hello,

First of all the program is great. I have a problem with switching between programs. I wrote a macro that goes to another program, presses a button and returns to FSX. The code looks like this:

Code: Select all

Dim wsh
Set wsh = CreateObject ("Wscript.Shell")
Wsh.AppActivate "ND"
SendKeys "c"
Sleep 10
Wsh.AppActivate "Microsoft Flight Simulator X with WideServer: 1 connected"
Macro passes between programs but does not send a "C" key. If I remove the last line of code (wsh.AppActivate "Microsoft Flight Simulator X with WideServer: 1 connected"), the macro works fine but does not return to FSX.

I solved this problem in this way:

Code: Select all

Dim wsh
Set wsh = CreateObject ("Wscript.Shell")
Wsh.AppActivate "ND"
SendKeys "c"
Sleep 10
HIDMacros.MouseClick 1300, 500, 1
However, I preferred solution 1, returning to FSX with the command "wsh.AppActivate" and not by mouse simulation. Do I need to add something to the code to work properly? I will be grateful for any help.

Regards,
Dominik

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests