Page 1 of 1

Focus on other already running program

Posted: Sun Aug 13, 2023 11:24 am
by sydneypais
Not so much a technical issue, but a key option or function that seems to be omitted.

Let's say I have 3 programs running: A, B and C, and I perform some Mouse button 4 and or 5 actions in B.

Now after that I want to shift focus to A or C, which I can achieve easily by including the {alt}{tab} with or without {shift} as the last instruction.
That works fine.

But if I want to go directly to A or C, I can't.

Because here is the situation:
If I have opened more program(s) (e.g. D, E, F.), that "handing over control to ..." last instruction isn't working anymore as intended.

Because, obviously, if I go from D to B, the {alt}{tab} in Mouse button 4 won't take me to A, but back to D.

Now I thought that the ACTIVATE would do the trick, but that's not the case. It's depending on where the cursor is (which is still in B).

The RUN:<application> starts a NEW event, and does not Activate or focus the already running one.

THAT is what i'm looking for.

Am I missing or misunderstanding something, or is simply not programmable?
To me this seems to be an enormous (automation) addition to the workflow.

Kind regards,

Sydney
(Amsterdam)

V2.20.5 / Installed / Windows 11 / 64 / Intel i9 /32G Ram (quite state of the art...)

Re: Focus on other already running program

Posted: Mon Aug 14, 2023 9:33 am
by phil
You are correct, that is not currently possible in XMBC.... There is no native Windows API to do this as far as I am aware either, without effectively searching the list of running applications, getting the window handle and trying to activate it.

That might be possible (with some effort) but it does have several potential issues too, for example, Generally I have 4 or 5 instances of Visual Studio open. They are all called DEVENV.exe (even between versions :?) so there would be no way to know which one you wanted to activate in that case....

Which makes it potentially quite a complex request!

Re: Focus on other already running program

Posted: Tue Aug 15, 2023 4:59 am
by sydneypais
Hi, Phil.

I understand, and it makes sense.

Thank you for your addressing this.

Sydney

Re: Focus on other already running program

Posted: Sat Nov 04, 2023 1:48 pm
by phil
I have added two new simkey tags in 2.21 Beta 20 that will hopefully allow you to activate another application directly:
{ACTIVATEP:<process.exe>} and {ACTIVATET:<Window Title>}

So you should be able to now do: {activatep:a.exe} or {activatet:calculator} for example!

Regards,
Phil