PDA

View Full Version : How do I switch focus to a program or load it needed



falken
April 7th, 2003, 05:54 AM
I'm a newbie on girder have been recommended to use to overcome a few other problems I was having.
What I want to do is to load a program on an event if it isn't already loaded. If it is then I just want to switch focus to it.
I'm sure it must be possible to accomplish it with Girder I just can't figure out how!!!

Magion
April 7th, 2003, 02:49 PM
Have you tried this?

3 simple commands:
WindowExists: Girder -> Window Exists
(first browse to "Set Focus", second to "Start Program")
Set Focus: Window -> Set Focus
Start Program: O.S. -> Execute

then you set your event to trigger the WindowExists command.

I haven't tried this myself but i think it should work. :D

/Magion

falken
April 8th, 2003, 11:51 AM
I tried this and it works perfectly when I test it from Girder. I set the eventstring up as navigator. Pressing f5 to test the command loads the program if it isn't already loaded otherwise it switched focus. Just what I wanted.
I opened a dos shell to test it with event
c:\program files\girder\event navigator
If the program wasn't loaded it was loaded but if it was it didn't switch focus but the Navigator tab on the task bar flashed.
When I tried it from myHTPC it didn't seem to do anything at all.
Please help me. I don't have enough hair to start tearing it out!!

Hagar
April 11th, 2003, 01:23 AM
I to am in the midst of assigning a remote button to bring a window to the front if it is open, or execute it if it is not.

I tried using State Commands but it only kinda sorta works.

I don't understand what Magion is outlining. Are these commands done in 3 separate 'Commands' or in the one and how?

I to am still learning Girder, so if you could please be blatent and spell it out for me :>

Thanks

kjheu
April 11th, 2003, 07:52 AM
It is done using one command. Add a new command...Click the Girder tab and select Window Exists from the drop down menu...Click the Target button and set the target as the application you want to test...Click the first Browse button and select the command you wish to run if the application is already running...Click the second Browse button and select the command you wish to run if the application is not running. The Window Exists command checks for the existance of the target. If the target exists it runs the command that is pointed to in the first browse box. If the target does not exist it runs the command that is pointed to in the second browse window.

falken
April 11th, 2003, 09:15 AM
Thats exactly what I've done. It just doesn't seem to be consistent. Some times it works, sometimes it opens it but in a smaller window and sometimes it doesn't work at all.

Hagar
April 11th, 2003, 05:25 PM
OK, I got this working for the most part.

My main issue now is with programs like PowerDesk which have multiple childs(?)/windows/frames(?) I am not 100% familiar with the Settings in the Target window - ie. Name, Class Name, Executable, Child Name, Child Class etc etc

The PowerDesk 'Name' changes with respect to what folder is being browsed and therefore cannot be a match for next time if that setting has been ticked. Am I on the right track here? I ticked only the Execute, but still minor problems.

What happens (sometimes) for example is when I have IE in the front and I can see PowerDesk in the background, when I press my PowerDesk button on the Remote, the titlebar of PowerDesk becomes highlighted but the window is not brought to the front. I figure this has something to do with targeting but not knowing what each of the 'settingss does I am a little stuck.

What next?

falken
April 13th, 2003, 09:36 AM
I've put together a simple Girder routine to load a program or switch focus to it if it is already running. Everything works perfectly in Girder testing. I then tried running it from within myhtpc, when I toggle between myhtpc and the other task, no problem. Once I have used any other command, particularly weather I can't get my other task to the front again. I've tried set focus, maximise and wait in various permutations without any consistent results. Sometimes it works, sometimes it doesn't.
This is a real stumbling block for me, so please can anyone offer any explanation or an insight into what the problem might be.

Foreman
April 15th, 2003, 10:52 AM
Oops wrong topic

jppanchaud
April 16th, 2003, 02:26 AM
Interesting post! I started with Girder in November and set up my system at the time exactly as per Magion. I have the same problem as falken though - unreliable for some reason and never found how to improve it...

I always target the .exe file only, maybe should we target another part of the application? Let's hope someone can solve this one falken!