SageTV Community  

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

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-27-2007, 08:11 PM
skyw33 skyw33 is offline
Sage User
 
Join Date: Oct 2004
Posts: 27
Fix for losing focus on dual monitor system

I have Windows XP with dual monitors. One of the monitors is dedicated to SageTV while the other is used for general computer use. If I'm typing an e-mail on one monitor while my wife is controlling SageTV with the remote, SageTV steals the focus whenever 'select' is pressed. I haven't found an adequate solution for this problem on this forum or anywhere. Ideally, SageTV would never take the focus, would always be in the foreground, and if any window inadvertently pops up on the SageTV monitor it would automatically be moved the other screen. In an effort to get what I want, I wrote the following AutoIt script. I hope others will find it useful too.

Code:
;if your monitors are virtually positioned one on top of the other then orientation = 1
;if side by side orientation = 0
$orientation = 1

;you'll have to experiment with this value to get this to work on your system
;if a window is greater than or equal to this value, it will be moved to the other monitor
$cutoff = -5

;hotkey for switching window to another monitor
$hotkey = "+{F1}"

;window name of program that frequently steals the window focus
$focus_stealer = "SageTV"

;Sleep(60000)
While 1
	$title1 = WinGetTitle("") 
	$text1 = WinGetText("")
	$handle1 = WinGetHandle("")
	WinWaitNotActive ( $handle1 )
	$title = WinGetTitle("")
	$text = WinGetText("")
	$handle = WinGetHandle("")
	$size = WinGetPos($handle)
	if $size <> 0 Then
		if $size[$orientation] >= $cutoff Then
			if $title <> $focus_stealer Then
				WinActivate($handle)
				Send($hotkey)
				WinActivate($handle)
			Else
				If BitAnd(WinGetState($handle1), 16) Then
					;MsgBox(0, "test", WinGetState($handle1))
				Else
					WinActivate($handle1)
				EndIf
			EndIf
		EndIf
	EndIf
	
WEnd
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Channel setup overseas (PAL) drpepper SageTV Beta Test Software 11 02-07-2008 02:47 PM
Vista, Dual Monitors and Sage reggie14 SageTV Software 20 09-17-2007 05:21 AM
Problem with maldude stv mouse focus nerys SageTV Customizations 0 03-15-2006 09:41 PM
Focus Problems rmbu SageTV Software 2 01-02-2006 03:34 PM


All times are GMT -6. The time now is 05:54 PM.


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