SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-09-2008, 01:54 PM
Morgan111's Avatar
Morgan111 Morgan111 is offline
Sage Fanatic
 
Join Date: Nov 2003
Location: Oak Ridge, Tennessee
Posts: 762
Question Launch an application and retain focus for remote

I am trying to launch Internet Explorer with ExecuteProcess() and then be able to respond to inputs from the remote control. I have tried calling a dll function after calling ExecuteProcess which does a find window on the Sage window and making it active and even foreground but have not had any luck. The focus to keyboard and remote remains on the IE window that was launched.

Any ideas?
Reply With Quote
  #2  
Old 04-09-2008, 03:16 PM
CollinR CollinR is offline
Sage Icon
 
Join Date: Dec 2004
Location: Tulsa, OK
Posts: 1,305
I suggest tring out EventGhost, the SageTV plugin works perfectly in this situation. IE has focus and remote control commands go to SageTV, so you can effectively surf and watch at the same time.

You can also launch IE resize and reposition the 2 windows from within EventGhost all in one stroke.

Code:
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1242">
    <Macro Name="MultiTask" Expanded="True">
        <Event Name="Main.Multitask">
        </Event>
        <Action>
            Window.FindWindow(u'SageTV.exe', u'SageTV', u'sage.SpecialWindow', u'', u'SunAwtCanvas', 7, False, 15.0, 0)
        </Action>
        <Action>
            Window.Restore()
        </Action>
        <Action>
            Window.Resize(640, 480)
        </Action>
        <Action>
            Window.MoveTo(0, 0)
        </Action>
        <Action>
            Window.FindWindow(u'iexplore.exe', u'Google - Windows Internet Explorer', u'IEFrame', None, None, 1, False, 0.0, 0)
        </Action>
        <Action>
            Window.BringToFront()
        </Action>
        <Action>
            Window.MoveTo(641, 0)
        </Action>
        <Action>
            Window.Resize(726, 768)
        </Action>
        <Action>
            System.Execute(u'C:\\WINDOWS\\system32\\osk.exe', u'', 0, False, 2, u'')
        </Action>
        <Action>
            Window.FindWindow(u'osk.exe', u'On-Screen Keyboard', u'OSKMainClass', None, None, 1, False, 30.0, 0)
        </Action>
        <Action>
            Window.MoveTo(0, 545)
        </Action>
    </Macro>
</EventGhost>
That is setup for a 1366x768 display with SageTV 640x480 and IE 726x768That will also bring up the on screen keyboard below SageTV so you can type with remote too.
Reply With Quote
  #3  
Old 04-09-2008, 03:21 PM
Brent Brent is offline
SageTVaholic
 
Join Date: May 2006
Location: KC, Missouri
Posts: 3,695
Quote:
Originally Posted by Morgan111 View Post
I am trying to launch Internet Explorer with ExecuteProcess() and then be able to respond to inputs from the remote control. I have tried calling a dll function after calling ExecuteProcess which does a find window on the Sage window and making it active and even foreground but have not had any luck. The focus to keyboard and remote remains on the IE window that was launched.

Any ideas?
Morgan,
Is this for coding in the Netflix plugin or are you trying to set up your remote to work with SageTV?
Reply With Quote
  #4  
Old 04-09-2008, 07:24 PM
Morgan111's Avatar
Morgan111 Morgan111 is offline
Sage Fanatic
 
Join Date: Nov 2003
Location: Oak Ridge, Tennessee
Posts: 762
CollinR, thanks for the suggestion. I'd rather not depend on a 3rd party app but I will check it out. In fact, from the Ghost parameters and commands you listed, I may be able to tweak up my dll to do what I want.

Brent, NetFlix of course!

Last edited by Morgan111; 04-09-2008 at 07:51 PM.
Reply With Quote
  #5  
Old 04-09-2008, 09:15 PM
Brent Brent is offline
SageTVaholic
 
Join Date: May 2006
Location: KC, Missouri
Posts: 3,695
Quote:
Originally Posted by Morgan111 View Post
I am trying to launch Internet Explorer with ExecuteProcess() and then be able to respond to inputs from the remote control. I have tried calling a dll function after calling ExecuteProcess which does a find window on the Sage window and making it active and even foreground but have not had any luck. The focus to keyboard and remote remains on the IE window that was launched.

Any ideas?
Quote:
Originally Posted by Morgan111 View Post
CollinR, thanks for the suggestion. I'd rather not depend on a 3rd party app but I will check it out. In fact, from the Ghost parameters and commands you listed, I may be able to tweak up my dll to do what I want.

Brent, NetFlix of course!
Ah. That's what I thought.

For the expert coders out there (I know you're here ) What Morgan needs is a way to launch the Internet Explorer Window (for the Netflix Watch-Now app) and execute windows commands that control the interface like girder does (explained further in this post). If anyone has any ideas post them here as we would love to see this added to the netflix plugin so girder wouldn't be required. Collin is on the right track with the eventghost settings he mentioned.
Reply With Quote
  #6  
Old 04-09-2008, 09:26 PM
Morgan111's Avatar
Morgan111 Morgan111 is offline
Sage Fanatic
 
Join Date: Nov 2003
Location: Oak Ridge, Tennessee
Posts: 762
Quote:
Originally Posted by Brent View Post
Ah. That's what I thought.

For the expert coders out there (I know you're here ) What Morgan needs is a way to launch the Internet Explorer Window (for the Netflix Watch-Now app) and execute windows commands that control the interface like girder does (explained further in this post). If anyone has any ideas post them here as we would love to see this added to the netflix plugin so girder wouldn't be required. Collin is on the right track with the eventghost settings he mentioned.
I am actually making progress in setting SageTV as the forground window and then making the IE player display as the topmost window. I have code to send Windows messages to the IE player although I still have to verify the exact messages to send for each command (Spy++ seems to be able to grab what data I need). My problem now is that I can run the code to make Sage receive the remote and keyboard, but not if it is called from Sage in a dll or in a seperate process using ExecuteProcess, but it works if I manually launch a process that executes that code to give it focus. So, I am at least getting closer.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 06:09 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.