Author |
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: March 31 2010 at 13:59 | IP Logged
|
|
|
This is another question dealing with the ability (or lack there of) to figure out how to set the window focus to a browser window (or browser child window).
Background - I'm trying to incorporate Google Calendar into my front end GUI (Xlobby). I would like to have Xlobby buttons fire PowerHome actions (sendkeys etc. - Google Calendar does have keystroke shortcuts).
Problem is, I can't figure out any way to set the window focus to Google Calendar when the keystroke commands are fired off.
Side Note: A good while back I ran into a similiar problem with Pandora (while running Pandora in the PH WebCenter). Unfortunately, that issue does not help me with this current challenge. Ideas?
Edited by smarty - March 31 2010 at 14:00
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
jbbtex Senior Member
Joined: February 15 2007 Location: United States
Online Status: Offline Posts: 181
|
Posted: March 31 2010 at 19:43 | IP Logged
|
|
|
Have you tried "ph_switchto"?
__________________ Brady
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity." - Gen. George S. Patton
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: April 01 2010 at 13:14 | IP Logged
|
|
|
Thanks for the reply, but I wish it was just that simple.
The "ph_switchto" approach require you to find the window handle.... and THAT is the tricky part. Please see the following link
Link
Anyone?
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
jbbtex Senior Member
Joined: February 15 2007 Location: United States
Online Status: Offline Posts: 181
|
Posted: April 01 2010 at 14:11 | IP Logged
|
|
|
I created a macro with these two lines.
ph_switchto("Google Calendar - Windows Internet Explorer",
1)
ph_sendkeys("1")
When it runs, the Google Calendar comes to the front and
then switches to the "Day" view. (assuming Google Calendar
is already open)
Edited by jbbtex - April 01 2010 at 14:29
__________________ Brady
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity." - Gen. George S. Patton
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: April 01 2010 at 16:09 | IP Logged
|
|
|
Hi Brady,
Yes, what you suggest does work. I probably didn't do a very good job in explaining the set up - sorry. Let me try again....
My front end GUI is called Xlobby. From within Xlobby, I can "imbed" a browser window showing the Google Calendar. This embedded browser window shows only the Google Calendar window, it does NOT have any of the Internet Explorer header stuff showing. Think of Internet Explorer as the wrapper that contains the Google Calendar window. In your example, the ph_switchto() command points to, and gives focus to the wrapper, and your sendkeys formual is successful.
In my case, I don't have (nor do I want it) the "wrapper" portion of Internet Explorer to point to. Instead, I have a child window of IE that the Google Calendar app is running in.
To all you programmers out there....I probabaly explained this with the wrong verbiage...forgive me as I am an engineer ....not a hard core code guy :)
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: April 01 2010 at 20:23 | IP Logged
|
|
|
Tried running Google Calendar in PH's Web Center......but no clean way to have that sit in Xlobby's GUI. :(
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: April 17 2010 at 19:59 | IP Logged
|
|
|
Smarty,
I played around with this (in the beta) and was able to do quite a few things. The PH Window Spy screen is great for this type of work. The only problem is that there is a bug in the current 2.1b version that prevents the message capture functionality from working so its difficult for you to do any of this at this time. It does work though for locating the proper window to send keystrokes to though and then you can use the ph_locatehandle function along with the ph_sendkeysmq function.
Even though its a child window, you should be able to use the Window Spy screen to properly identify and locate the window.
Dave.
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: April 18 2010 at 10:28 | IP Logged
|
|
|
dhoward wrote:
....It does work though for locating the proper window to send keystrokes to though and then you can use the ph_locatehandle function along with the ph_sendkeysmq function.
Even though its a child window, you should be able to use the Window Spy screen to properly identify and locate the window.
Dave.
|
|
|
I have used the "Window Spy" a fair amount in the recent past for locating window handles and then sending keys to the found handle....that is how I control my Geovision Camera system.
See the attached picture.
You can see that "Window Spy" says that that the Google Calendar window is 329060 (the mouse WAS over the calendar area...just not showing in the pict). You can also see that I was trying to send that handle a sendkeys for a "w" (the week view"). It did not work, the view did not change.
When I try this same experiemnt outside of Xlobby (in other words I just open up a browser window and navigate to Google Calendar), I can find the proper window in the same manner, and here, the sendkeys does work.
Therefore, I am thinking the key issue may be when I "embed" the IE Google Calendar window into Xlobby, something happens there.
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|
smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: April 18 2010 at 10:41 | IP Logged
|
|
|
See this picture...
When I send keys to the Xlobby window that surrounds the
"embeded" calendar (mouse WAS over the Xlobby blue colored region), there is still no effect.
Note what is displayed in the Window Spy box....some sort of 'handle wrapper'????
Edited by smarty - April 18 2010 at 10:42
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|
Back to Top |
|
|