CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2007
    Posts
    13

    Question Is an app with "system tray" icon OK for a continually running scheduler, or should I

    Hi,

    Requirement - I have a periodic task I want to run in a windows environment for my application. It will have a simple interface that allow some basic configuration (e.g. URLs & how often to run it). I want it to run every X hours (configurable) when the machine is running.

    Question - Do I just create an application with a system tray presence for this? Or should I be creating a service that has a separate UI that hooks into it.

    BY THE WAY - I'm a beginner C# developing using Visual Studio Express keep in mind. Also if you could give a quick overview of the design of what you recommend that would be great for a newbie (e.g. if you suggest a service, does this mean you really need one application for the service, and another application that has a UI that does the configuration for the service?)

    thanks

  2. #2
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    Re: Is an app with "system tray" icon OK for a continually running scheduler, or shou

    Quote Originally Posted by callagga View Post

    Question - Do I just create an application with a system tray presence for this? Or should I be creating a service that has a separate UI that hooks into it.
    It depends on what you want to achieve.

    If the periodic task needs to tun all the time (on a server), you need to create a Windows Service. If you want this periodic task only to run when you are working on your pc, a Windows application could just do fine.

    When you create a normal Windows application, it is not guaranteed that it runs. You could place it under 'startup' of Windows, but it will only start when you log in. That would mean that after a server reboot the application won't run untill you login.

    A Windows Service can be configured that it always runs, even if you haven't login (for example SQL Server/MySQL)

  3. #3
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Is an app with "system tray" icon OK for a continually running scheduler, or shou

    1. You can have a Windows App Or Service and keep time check in it
    Or
    2. Use Task Scheduler to run the application which has only the required work coded.
    Regards,
    Ramkrishna Pawar

  4. #4
    Join Date
    Aug 2007
    Posts
    13

    Re: Is an app with "system tray" icon OK for a continually running scheduler, or shou

    Quote Originally Posted by Krishnaa View Post
    1. You can have a Windows App Or Service and keep time check in it
    Or
    2. Use Task Scheduler to run the application which has only the required work coded.
    thanks

    which of the 3 options would it be easiest to allow a simple UI to allow the user to configure the period for running the task? Like:

    - re scheduled task- can a UI be used to configure this
    - re app in system tray - understand this one
    - re service - how would the UI interface with the service? Would need DB or common config file area shared between them?

    Sounds like the simple app that minimizes to the system tray might be easiest. I assume one could configure an installation to put the app into the users startup area?

    Thanks




    - re sch

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Is an app with "system tray" icon OK for a continually running scheduler, or shou

    Quote Originally Posted by dannystommen View Post
    When you create a normal Windows application, it is not guaranteed that it runs. You could place it under 'startup' of Windows, but it will only start when you log in. That would mean that after a server reboot the application won't run untill you login.
    Another option is to add an entry to the Run key under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion.

    An application placed under this key will run when the machine starts up (regardless if any user is logged on).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured