View Single Post
  #2  
Old 11-01-2011, 10:46 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can use the win32gui.GetForegroundWindow function to get a handle to the active window. You can check this handle against the Vizard window handle to determine whether Vizard has focus:
Code:
import win32gui

def VizardHasFocus():
	return win32gui.GetForegroundWindow() == viz.window.getHandle()

if VizardHasFocus():
	print 'Vizard has focus'
else:
	print 'Vizard does not have focus'
Reply With Quote