473,386 Members | 1,738 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,386 software developers and data experts.

Screen savers: How do I spawn a new process...

I have a machine that will be used to demo some Excel spreadsheets at a
convention. Because I did not author the spreadsheets and attendees will be
allowed to play with the spreadsheets, I needed a way to periodically
restore the original versions. In addition to the "always-on-top click this
button to reset demo" application I wrote, I chose to use screen saver code
to reset the demo after a period of inactivity in the event an attendee just
walked away. I chose the screen saver method because I was unsure how to
capture the system traps since my reset-app will not always have focus and
so using the screen saver method seemed to be the quickest/easiest solution.

So...

I can spawn a new process from an application and that process remains
running after the application is closed. This is good.

Using the same code in a screen saver and running it while its an .EXE
(prior to renaming it .SCR & relocating it to the system directory), the new
process remains running after the screen saver application is closed. This
is good.

I rename the screen saver to .SCR, relocate it in the system directory,
right-click the Desktop background, select Properties / Screen Saver / etc.,
click the Preview button to execute the screen saver and the new process
remains running after I select Ok or Cancel to cancel the screen saver.
This is good.

Now I allow the system to kick off the screen saver at whatever inactivity
timeout. The screen saver executes, the new process executes but it closes
when the screen saver closes. This is bad.

Here is the code being used:

private void ScreenSaverForm_Load(object sender, System.EventArgs e)
{
string InstallPath =
(string)Registry.LocalMachine.OpenSubKey(@"SOFTWAR E\MyApp").GetValue(@"Path");
ProcessStartInfo startInfo = new ProcessStartInfo(InstallPath +
@"\MyFile.xls");
startInfo.WindowStyle = ProcessWindowStyle.Maximized;
Process.Start(startInfo);
Close();
}

I have also tried including "startInfo.UseShellExecute = true;" but results
were the same.

Unless I am totally off then obviously the operating system is
handling/executing screen saver code differently at the final stage. Other
than basic skeleton code required for a screen saver, I am unable to find
any 'real' documentation on screen saver programming. For example, through
trial & error I discovered that the screen saver filename must follow the
8.3 naming convention - unless I'm doing something wrong there as well?
Anyway...

1. Most importantly, what is the code for spawning a new process from within
a system activated screen saver such that the new process remains running
after the screen saver closes?

2. Is a screen saver filename in fact limited to the 8.3 naming convention?

3. Where is the screen saver application name set or read from? For example;
if your filename is 'ssMyDemo.scr' then the system will drop the prefix of
'ss' and display 'MyDemo' in the screen saver list. If there is no 'ss'
then the filename, excluding extension, will display in the screen saver
list. But if you examine a default OS provided screen saver you will see
that the filename 'ss3dfo.scr' displays as '3D Flying Objects' in the screen
saver list. How is this accomplished?

4. Is there a "Everything you ever wanted to know" type source on screen
saver programming; net, book or otherwise?

TIA,
-Jeff

Dec 7 '05 #1
0 3241

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

Similar topics

1
by: Timmah | last post by:
I have a Visual Basic menu script that I am trying to get to clear the dos screen it is running in. Basically, you select an option from the menu, and after the processing is complete, a "press...
7
by: C Gillespie | last post by:
Dear All, I have a function def printHello(): fp = open('file','w') fp.write('hello') fp.close() I would like to call that function using spawn or fork. My questions are:
1
by: googlemike | last post by:
I'm trying to use Python and PyGTK + Glade, along with Bash. I want to make a GUI for the Linux vpnclient command-line tool. (Look for linux-vpnclient.tar.gz on the Internet if you are curious.)...
3
by: Paul | last post by:
Hi all. Can someone provide some help on the following as there seems to be many different methods of acheiving the same outcome. Basically I am trying to develop a web service which will...
4
by: Shawn Mehaffie | last post by:
I have created a screen saver using VB.Net but cannot find any articles or examples on how to write the code for the /p parameter (display in dialog preview window). All the .Net exmaples I have...
2
by: kevin | last post by:
Not sure if this is the right place for this, if not please direct me accordingly. I have made a screen saver, and it has some options. How do I get those options to be available from the Windows...
3
by: Sinan Nalkaya | last post by:
hi, i am using os.spawn function, it works well but i need a flag that allows function return the process id with exit/error code, is there any or how can i do it, i can replace spawn with...
3
by: somuchh8 | last post by:
Hi, I'm having a lot of trouble with the Win32::Spawn module in perl. Here is my situation, I have a Win32::Spawn call which looks like this: my $success = undef; my $cmdline =...
4
by: Brendan Miller | last post by:
I want to spawn a child process based on an external executable that I have the path for. I then want to wait on that executable, and capture it's output. In the os module, fork is only...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.