Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6900993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:37:03+00:00 2026-05-27T07:37:03+00:00

I’m implementing a screensaver to restart a background application. My need is to restart

  • 0

I’m implementing a screensaver to restart a background application. My need is to restart firefox to reset the home page in a windows kiosk. I would like to do this with a Screen Saver. The language I use is C#.

The code is not so complex and is a sort of copy and paste from

http://msdn.microsoft.com/en-us/library/windows/desktop/ms686421(v=vs.85).aspx

and

http://www.harding.edu/fmccown/screensaver/screensaver.html

It should work in this manner: the screensaver starts, then after 10 sec. kills the application (if it exists) and then, after 10 sec. again it restarts the application. After all the screensaver quit (there is a timer that drives this).

The problem is that the process started by the screensaver has a sort of link to the killed screensaver, because until the user doesn’t kill the application, the screensaver doesn’t restart!

I use this function to restart the application:

public static void StartAProcess(string executableName)
{
    //Process.Start(new ProcessStartInfo(executableName));

    RunThread ext = new RunThread();
    Thread t = new Thread(new ParameterizedThreadStart(ext.OpenProcess));
    t.Start(executableName.ToString());
}


public class RunThread
{
    public void OpenProcess(object executableName)
    {
        ProcessStartInfo si = new ProcessStartInfo();
        si.UseShellExecute = true;
        si.FileName = (string) executableName;
        Process proc = Process.Start(si);
        ---> if (null != proc)
             proc.WaitForExit();   // Block until exit**
    }
}

The behaviour is different depending on the OS and the WaitForExit instruction:

  • with WaitForExit: on Seven, Vista and XP, after the start of the application, the screensaver doesn’t restart;
  • without WaitForExit: on Vista/Seven the same of prec point, on Windows XP when the screensaver exit it kills the application too!
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:37:03+00:00Added an answer on May 27, 2026 at 7:37 am

    Windows protects itself from the behavior you’re trying to code by running the screen saver in a job object that prevents any process started from “escaping” from the job. That way the screensaver can’t leave any processes running when the user doesn’t expect. Windows will either terminate the job (and thus all of the processes started within it) when the screensaver process terminates (WinXP) or it will wait until the the job object itself terminates (i.e. every process in the job terminates).

    It’s not clear why you’re using a screensaver for this. I probably would either use a program that runs on startup or a service to do something like this.

    Regardless, if you have to use a screensaver, you have to find a way to create a process from outside your job object. One thing to consider is the Create method of the Win32_Process Class.

    Based on your indication that you want to restart Firefox, it sounds like you have an Internet kiosk type of application where you want to restart the browser when the user has left the kiosk. In that case I would recommend something else entirely:

    • Create a program that starts Firefox, waits for it to exit, then restarts it, all running in an infinite loop. Run this program using some sort of AutoRuns-like mechanism.

    • Make your screensaver simply kill Firefox and exit. When the screensaver activates, it will kill Firefox and exit, causing the looping program to restart it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.