473,324 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

full screen graphics

Hello,

I need to run a particular graphics application over and over again
with a different command line to get benchmarks on the applications
performance (frame rates and similar data). I am running the following
within a while loop that parses out a different command line from a
configuration file.

############
def runCommand(command):
"""runCommand(command)

Parameters:
command -- the full string of the command to execute

"""
print command
try:
childProcess = subprocess.Popen(command)

done = False
while not done:
returnCode = childProcess.poll()
if (returnCode != None):
done = True
else:
# sleep for 10 seconds before checking again
time.sleep(10)
except KeyboardInterrupt:
print 'KeyboardInterrupt received. Trying to kill Wolf2.exe'
print '>TASKKILL /F /T /PID ', childProcess.pid
killCommand = ''.join(('TASKKILL /F /T /PID ',
str(childProcess.pid)))
killSubProcess = subprocess.Popen(killCommand)
killSubProcess.wait()
sys.exit(0)
except OSError, (errno, strerror):
print 'OS Error (%s): %s' % (errno, strerror)
print 'Above error occurred while executing the following:'
print command
except WindowsError, (errno, strerror):
print 'MS Windows Error (%s): %s' % (errno, strerror)
print 'Above error occurred while executing the following:'
print command
##########

The problem lies in that the second time the application is run, it
doesn't grab focus and go full screen, but sits paused. It will not
continue running until I click on the minimized application in the
taskbar. Is there any way to force it to grab focus?

I am running on Win32 with Python 2.5.1.

Your help in this matter is greatly appreciated,
Mick Charles Beaver

May 21 '07 #1
1 2576
On May 21, 8:39 am, myheartinamerica <myheartinamer...@gmail.com>
wrote:
Hello,

I need to run a particular graphics application over and over again
with a different command line to get benchmarks on the applications
performance (frame rates and similar data). I am running the following
within a while loop that parses out a different command line from a
configuration file.

############
def runCommand(command):
"""runCommand(command)

Parameters:
command -- the full string of the command to execute

"""
print command
try:
childProcess = subprocess.Popen(command)

done = False
while not done:
returnCode = childProcess.poll()
if (returnCode != None):
done = True
else:
# sleep for 10 seconds before checking again
time.sleep(10)
except KeyboardInterrupt:
print 'KeyboardInterrupt received. Trying to kill Wolf2.exe'
print '>TASKKILL /F /T /PID ', childProcess.pid
killCommand = ''.join(('TASKKILL /F /T /PID ',
str(childProcess.pid)))
killSubProcess = subprocess.Popen(killCommand)
killSubProcess.wait()
sys.exit(0)
except OSError, (errno, strerror):
print 'OS Error (%s): %s' % (errno, strerror)
print 'Above error occurred while executing the following:'
print command
except WindowsError, (errno, strerror):
print 'MS Windows Error (%s): %s' % (errno, strerror)
print 'Above error occurred while executing the following:'
print command
##########

The problem lies in that the second time the application is run, it
doesn't grab focus and go full screen, but sits paused. It will not
continue running until I click on the minimized application in the
taskbar. Is there any way to force it to grab focus?

I am running on Win32 with Python 2.5.1.

Your help in this matter is greatly appreciated,
Mick Charles Beaver

If your graphics program uses COM you may be able to do something like
what's done in the following post:

http://mail.python.org/pipermail/pyt...ne/327261.html

I found this too, but I haven't tested it myself: http://downgra.de/articles/python-wmii/

You may be able to use Tim Golden's WMI module too. I would think you
could use his "enumerate all running processes" and combine it with
the "run a process minimized", except you'd change the flag so that it
maximized instead. See link below:

http://tgolden.sc.sabren.com/python/wmi_cookbook.html

Hopefully that'll help you some.

Mike
May 21 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Els | last post by:
Hi, i have the following script in the head of my document: <script language="Javascript"> <!-- // *********************************************** // AUTHOR: WWW.CGISCRIPT.NET, LLC // URL:...
2
by: Larry R Harrison Jr | last post by:
I have pull-down menus in javascript and I have the code for opening a link in a new window. But I want it to open a full-sized window. I can't figure out the syntax. What I have so far: ...
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
8
by: benben | last post by:
I created a form and overrided OnPaint, OnClick and OnResize methods. My OnPaint calls base.OnPaint then repaints the whole screen. The screen flickers a lot! It didn't happen when the app was...
6
by: redneon | last post by:
Is it possible to draw directly to the screen using the .net libraries? I thought that it might be possible with GDI+ but I can't find out how to do it anywhere. A part of me suspects I may have to...
3
by: Doominato | last post by:
good day everyone, i'm writing an app in which i would like to implement full-screen capability. i would like to know if there is a way of getting a program to cover the whole screen, such as...
0
by: Franklin M. Gauer III | last post by:
Hi, We have an application running that uses FULL SCREEN ANCHORING in Windows Forms. The application runs fine on all of our desktops and some laptops. We are having problems with certain Dell...
6
by: NvrBst | last post by:
Hello. I can pInvoke "GetDC" with NULL or "IntPtr.Zero" and get the hDC for the entire screen. I can use the hDC for stuff like "GetPixel" and it works fine. When I try to do the... ...
2
by: raylopez99 | last post by:
Beware newbies: I spent a day before I figured this out: copying a bitmap (image) file to file is not quite like copying a text file--you have to do some tricks (see below), like using a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.