PDA

View Full Version : window creation event



Selyb
December 1st, 2003, 08:30 PM
is it possible to use window creation as an event?
from an already running program
e.g. preferences window of winamp

miked
December 1st, 2003, 11:45 PM
The task create event will do this -- basically, it generates an event any time a window is closed or opened. You'll then need to check which window has focus to figure out if it's one that you want to deal with.

I've found that with at least one program, myhtpc, you need to wait a bit (i use 2.5 seconds) before checking focus, after the event is detected by girder -- I think girder works faster than Windows, so you get the event that a task has been created (window open or close), but if you immediately check which window has focus, Girder does this check before Windows actually has time to give the new window focus . . . .

tss
March 19th, 2004, 05:53 AM
That works most of the time but I need it to work for a child window for a task being created. In this specific scenario I want to just automagically OK a pop up window but onTaskSwitch doesn't capture it as a TaskSwitch event if the window creation is part of the same task :-(

Can anyone help?

audiophile
March 22nd, 2004, 09:32 PM
I'm trying to do exactly the same with Winamp's Preferences window, so Girder will automatically close the window if anyone dares to tamper with Winamp's preferences. Sadly neither TaskCreate nor TaskSwitch can catch this window.

Anybody knows a workaround?

Audiophile

Promixis
March 23rd, 2004, 03:44 AM
We are planning some lua extensions for window control but this won't be out for sometime and may or may not solve the problem...

In the mean time, you could try using the FindWindow function and poll it every few seconds... (not elegant but may work...)

Mikefield
March 23rd, 2004, 09:33 AM
How do you enable winamp preferences?
Press Strg-P with keyboard?
Send a remote event?

With keyboard, or remote, both create an event.
But only when the mouse is used, girder sleeps. :)

The only one is a 1 sec time loop, with an "if exist" command,
that will close the window if true.
Your CPU would be happy over this nice work. :)

But what will you doing when someone close girder ...
shutdown the computer


mf

tss
March 23rd, 2004, 10:21 AM
In the mean time, you could try using the FindWindow function and poll it every few seconds... (not elegant but may work...)
Is FindWindow a LUA function? How do I poll without stopping other events from getting triggered in Girder? Because if I understand things correctly the Wait command stops new events? Or am I wrong?

Mikefield
March 23rd, 2004, 10:37 AM
Sorry Mike is yours to answer.

Without lua:
You can use the "if exist" comand with right targeting. It's find also a window.
The problem is to find an event that girder can activate this comand.
You can use taskswitch, taskcreate or on all girder commands.
The wait command, stop not new events or comands, it waits for the time you set it up,
before Girder go to the next comand i.e. in a multigroup.


mf

Mikefield
March 23rd, 2004, 10:38 AM
Sorry Mike is yours to answer.

Without lua:
You can use the "if exist" comand with right targeting. This find also a window.
The problem is to find an event that girder can activate this comand.
You can use taskswitch, taskcreate or on all girder commands.
The wait command, stop not new events or comands, it waits for the time you set it up,
before Girder go to the next comand i.e. in a multigroup.


mf

Promixis
March 23rd, 2004, 11:03 AM
In the mean time, you could try using the FindWindow function and poll it every few seconds... (not elegant but may work...)
Is FindWindow a LUA function? How do I poll without stopping other events from getting triggered in Girder? Because if I understand things correctly the Wait command stops new events? Or am I wrong?

You can either use the LUA FindWindow or the IsExists Girder command.

You would want to setup the alarm timer to poll every few seconds or less. The wait command is blocking so don't use it.