Help Please... Activating another task's window

We have an application that handles ‘global’ hotkey, i.e. hotkeys like
print-screen that have a system wide effect. Usually, such keys are used
to select (give focus to) another photon application.

This app opens a region and receives ALL keyboard input. If the key pressed
has no special action associated with it, it re-emits it so it can be
processed normally. If the key has an ‘activate’ action defined, the app
tries to locate the task name from the task list on the current node, when
it finds it, it tries to activate that task’s window by sending a Focus
window event
to it (given it’s pid). We call it the ‘target’ process.

If I emit only a ‘Focus’ event, the windows doesn’t come forward, so addet
emission of a
ToFront event first then I emit the ‘Focus’ event.

==> The problem is that Photon doesn’t switch to the console on which the
program’s window is located, like I want to.

If the target process’ window is located on a console that is not the
current console, the window gets selected but it is not visible to the user.

I tried the ‘SUPERSELECT’ pseudo-event but it breaks something else in some
of our application because it seems that the Superselect makes the window
Loose the focus and gain it back again afterwards but I don’t want to get
into these details too much.

Also, Superselect does not perform exactly what I want because it actually
bring the task’s window into the current console which is not what I want.

Q: Is there a way to simulate the action of selecting an application in the
task bar, which perform’s exactly what I want ?

This is exactly what the global-hotkey app needs to emulate. I thought that
sending a ToFront event to it would switch the current console to the
console on which the window is located but it’s not…

P.s. I’m Using Photon 1.14 A or B (can’t recall and I can’t check from
where I am now)…

\

marclupien@hotmail.com

Hi Marc,

You can use the PtConsoleSwitch(int console). This will switch you between
virtual consoles if you know the number of the console that your looking for.

Hope this helps
Regards
Brenda

Marc Lupien <marclupien@hotmail.com> wrote:

We have an application that handles ‘global’ hotkey, i.e. hotkeys like
print-screen that have a system wide effect. Usually, such keys are used
to select (give focus to) another photon application.

This app opens a region and receives ALL keyboard input. If the key pressed
has no special action associated with it, it re-emits it so it can be
processed normally. If the key has an ‘activate’ action defined, the app
tries to locate the task name from the task list on the current node, when
it finds it, it tries to activate that task’s window by sending a Focus
window event
to it (given it’s pid). We call it the ‘target’ process.

If I emit only a ‘Focus’ event, the windows doesn’t come forward, so addet
emission of a
ToFront event first then I emit the ‘Focus’ event.

==> The problem is that Photon doesn’t switch to the console on which the
program’s window is located, like I want to.

If the target process’ window is located on a console that is not the
current console, the window gets selected but it is not visible to the user.

I tried the ‘SUPERSELECT’ pseudo-event but it breaks something else in some
of our application because it seems that the Superselect makes the window
Loose the focus and gain it back again afterwards but I don’t want to get
into these details too much.

Also, Superselect does not perform exactly what I want because it actually
bring the task’s window into the current console which is not what I want.

Q: Is there a way to simulate the action of selecting an application in the
task bar, which perform’s exactly what I want ?

This is exactly what the global-hotkey app needs to emulate. I thought that
sending a ToFront event to it would switch the current console to the
console on which the window is located but it’s not…

P.s. I’m Using Photon 1.14 A or B (can’t recall and I can’t check from
where I am now)…


marclupien@hotmail.com

Hi Marc,

I did some more checking and there is also a call for

PtWindowConsoleSwitch( PhRid_t rid ).

The function causes PWM to switch the current display to the console where
the window specified by rid is located. The rid is the region of the task
window, and may be obtained with PtWidgetRid().

Hope this helps
Thanks
Brenda

Gui Group <gui@qnx.com> wrote:

Hi Marc,

You can use the PtConsoleSwitch(int console). This will switch you between
virtual consoles if you know the number of the console that your looking for.

Hope this helps
Regards
Brenda

Marc Lupien <> marclupien@hotmail.com> > wrote:

We have an application that handles ‘global’ hotkey, i.e. hotkeys like
print-screen that have a system wide effect. Usually, such keys are used
to select (give focus to) another photon application.

This app opens a region and receives ALL keyboard input. If the key pressed
has no special action associated with it, it re-emits it so it can be
processed normally. If the key has an ‘activate’ action defined, the app
tries to locate the task name from the task list on the current node, when
it finds it, it tries to activate that task’s window by sending a Focus
window event
to it (given it’s pid). We call it the ‘target’ process.

If I emit only a ‘Focus’ event, the windows doesn’t come forward, so addet
emission of a
ToFront event first then I emit the ‘Focus’ event.

==> The problem is that Photon doesn’t switch to the console on which the
program’s window is located, like I want to.

If the target process’ window is located on a console that is not the
current console, the window gets selected but it is not visible to the user.

I tried the ‘SUPERSELECT’ pseudo-event but it breaks something else in some
of our application because it seems that the Superselect makes the window
Loose the focus and gain it back again afterwards but I don’t want to get
into these details too much.

Also, Superselect does not perform exactly what I want because it actually
bring the task’s window into the current console which is not what I want.

Q: Is there a way to simulate the action of selecting an application in the
task bar, which perform’s exactly what I want ?

This is exactly what the global-hotkey app needs to emulate. I thought that
sending a ToFront event to it would switch the current console to the
console on which the window is located but it’s not…

P.s. I’m Using Photon 1.14 A or B (can’t recall and I can’t check from
where I am now)…


marclupien@hotmail.com