none
How do I run a Win32 C++ console app via a Windows Service RRS feed

  • Question

  • The purpose of the Windows Service is to run the C++ console app.  I need a notification icon in the bottom right when they are running.  I also need it to boot on Windows Start up.  How do I go about accomplishing that?

    Thursday, March 7, 2013 10:43 PM

Answers

  • In general, a service can't interact with the desktop - so there's no way to get a notification icon when services are running.  That requires having a user-application which communicates with the service, so it can run as part of the user's desktop account.

    As for scheduling a console application to run - often, Windows Task Scheduler is far nicer than a service for this purpose. 


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Thursday, March 7, 2013 11:21 PM

All replies

  • In general, a service can't interact with the desktop - so there's no way to get a notification icon when services are running.  That requires having a user-application which communicates with the service, so it can run as part of the user's desktop account.

    As for scheduling a console application to run - often, Windows Task Scheduler is far nicer than a service for this purpose. 


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Thursday, March 7, 2013 11:21 PM
  • On 3/7/2013 5:43 PM, Future Progress wrote:

    <snipped>

    I think you have a misconception about what a WCF service is about. Can a WCF service call a method in a classlib project in an async manner to do what you want? It probably can do it. But that's not a WCF function.

    http://msdn.microsoft.com/en-us/library/ms731082.aspx

    Thursday, March 7, 2013 11:31 PM
  • Thanks Reed.  I appreciate your help.

    Can you link me to something about Windows Task Scheduler that would work in conjunction with a WPF and Win32 C++ console app contained in a Solution for my purposes?

    Thursday, March 7, 2013 11:34 PM
  • Thanks Reed.  I appreciate your help.

    Can you link me to something about Windows Task Scheduler that would work in conjunction with a WPF and Win32 C++ console app contained in a Solution for my purposes?

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

    The nice thing about Windows Task Scheduler is that you can set it to run as a specific user.  You'd still need to make your WPF run on user login, though, if you want it to communicate via the notification area with the user...


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Friday, March 8, 2013 12:01 AM
  • Sorry. I do mean WPF and not WCF.  How do I switch it to the appropriate area?
    Friday, March 8, 2013 12:02 AM
  • On 3/7/2013 7:02 PM, Future Progress wrote:

    Sorry. I do mean WPF and not WCF.  How do I switch it to the appropriate area?

    Msdn.en-US.wpf

    Friday, March 8, 2013 1:27 AM
  • On 3/7/2013 7:02 PM, Future Progress wrote:

    Sorry. I do mean WPF and not WCF.  How do I switch it to the appropriate area?

    Msdn.en-US.wpf

    @darnold924

    I mean changing the category from WCF to WPF.  Where can i do that?


    Friday, March 8, 2013 1:37 AM
  • On 3/7/2013 8:37 PM, Future Progress wrote:

    On 3/7/2013 7:02 PM, Future Progress wrote:

    Sorry. I do mean WPF and not WCF.  How do I switch it to the appropriate area?

    Msdn.en-US.wpf

    @darnold924 <http://social.msdn.microsoft.com/profile/darnold924/?ws=usercard-mini>

    I mean changing the category from WCF to WPF.  Where can i do that?


    I don't know what you are talking about. :)

    Friday, March 8, 2013 2:13 AM
  • On 3/7/2013 8:37 PM, Future Progress wrote:

    <snipped>

    Oh, one other thing, I didn't know that a profile on me was being kept. I do remember getting something in an email from MS giving me a subscription to Safari Books on line and a certificate about being a valued member. :) All that was a couple of years ago.

    Friday, March 8, 2013 2:28 AM
  • That's how they get you lolz.
    Monday, March 11, 2013 11:37 PM
  • Hi,

    From your further descriptions, it seems the issue is related to WPF, you can open a thread with detail description of the issue in WPF forum.

    http://social.msdn.microsoft.com/forums/en-US/wpf/threads/

    There are more professionals on wpf, so that you can get better support. Thanks for your understanding.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 12, 2013 5:59 AM
    Moderator