简体   繁体   中英

Background process without a window

I need to prepare a program which runs in the background without a window or anything on the taskbar. You may compare this to the idea of a program which runs in the background and sends a signal every once in a while to keep the computer from sleeping. So here are the two ideas that I have on my mind

1) Creating a windows Service
2) Spawning a thread and exiting main

Please let me know how viable these are, particularly the second one, and what other possibilities do we have at our disposal.

Thanks in advance!!

If you're looking to run a background process then go with the service approach. You'll be able to configure it to run even when nobody is logged in and it won't be intrusive to the user.

只需将您的应用程序链接到windows子系统,而不是console

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM