Thread: Background program

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    7

    Question Background program

    Hi I'd like some help on how to make a program that keeps running on the background.
    Even if it is minimized, I wanted it to still be running.
    Any help or info about it, or anywhere I can find is great!
    thx in advance

  2. #2
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,534
    Quote Originally Posted by khelmo
    Hi I'd like some help on how to make a program that keeps running on the background.
    Even if it is minimized, I wanted it to still be running.
    Any help or info about it, or anywhere I can find is great!
    thx in advance
    Are you on a *nix type of system? Is the program running from (in) a shell?

  3. #3
    Registered User
    Join Date
    May 2004
    Posts
    7
    No I'm using Windows =(

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    So, is it running in a Windows Console (command line style) or do you want it running in the GUI (albeit hidden)?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #5
    Registered User
    Join Date
    May 2004
    Posts
    7
    win32 console
    My OS is WindowsME and my compiler MS VS C++ 6.0
    Last edited by khelmo; 08-10-2004 at 05:16 PM.

  6. #6
    Obsessed with C chrismiceli's Avatar
    Join Date
    Jan 2003
    Posts
    501
    Don't linux daemons fork() a new process that is the background process, and then kill themselves, making the new process a zombie (running in the background and hard to kill)? If so, you could do something similar in windows I am guessing.
    Help populate a c/c++ help irc channel
    server: irc://irc.efnet.net
    channel: #c

  7. #7
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    I'm not sure if you could do it in C, but windows services offer this kind of functionality. Also, a lot of programs will still technically be active, but when you click the close button or something similar, they hide all of their interface. I'm sorry to say however, I have no idea how you would go about this in C without a great deal of difficulty.

  8. #8
    Registered User
    Join Date
    May 2004
    Posts
    7
    Quote Originally Posted by chrismiceli
    Don't linux daemons fork() a new process that is the background process, and then kill themselves, making the new process a zombie (running in the background and hard to kill)? If so, you could do something similar in windows I am guessing.
    Sorry, I didn't quite understand what you said!
    (I speak portuguese)
    /////////////////////////
    Let me give an example of a program:

    Lets say I wanted to read whenever a key is pressed and write it on a file BUT it must work even if the active window isn't the application itself; like I was typing in the notepad and my application running on the background is reading the keyboard and writing the chars on a file at the same time!
    Last edited by khelmo; 08-10-2004 at 07:38 PM.

  9. #9
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    ... in other words spyware?

  10. #10
    Registered User
    Join Date
    May 2004
    Posts
    7
    in my own PC lol, but I don't really want to do it for that reason! If I did, I'd download something from the net, it's really easy to...
    I want to learn cuz I've always thought about it and is quite interesting.

    I'm only guessing but doesn't it have anything to do with threads?
    Last edited by khelmo; 08-10-2004 at 07:45 PM.

  11. #11
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Oh ok then.

    No I don't think it would have anything to do with threads. At least not at the program level - definately at the system level, but you don't have to worry about that. I would recommend doing this project in C++ (if it's not too much of a problem for you) as C++ libraries will offer a much wider variety of options as far as windows programming

  12. #12
    Registered User
    Join Date
    May 2004
    Posts
    7
    Quote Originally Posted by sean_mackrory
    Oh ok then.

    No I don't think it would have anything to do with threads. At least not at the program level - definately at the system level, but you don't have to worry about that. I would recommend doing this project in C++ (if it's not too much of a problem for you) as C++ libraries will offer a much wider variety of options as far as windows programming
    I might do that then, thx man

    If anyone knows more about this problem, feel free to post
    I'll keep studing!

  13. #13
    Registered User
    Join Date
    Feb 2003
    Posts
    175
    Develop Keyboard filter driver

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  2. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  3. How to complete program. Any probs now?
    By stehigs321 in forum C Programming
    Replies: 7
    Last Post: 11-19-2003, 04:03 PM
  4. forcing a program to run in the background?
    By Geo-Fry in forum Tech Board
    Replies: 4
    Last Post: 10-27-2003, 08:11 PM
  5. Running program on background?
    By Couhilin in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2001, 07:50 AM