Closing the console
I use bloodshed dev-C++ compiler on vista and i made a program in C but i want to be able to stop the console window showing but i dont know how to do this. I want this program to constantly run in the backgroud without a window open for it. I dont know how to get rid of it. Is there some code or just an option i can turn off? If so i haven't seen it and yes I have googled a lot but found nothing.
To my knowledge, the only way of accomplishing that is to use the Windows API to create a GUI-type application, but then you never create a window onscreen. There isn't a way to do it with standard C, since the console is just a low level way of interfacing with a program, and the only portable way possible, so if Windows determines that the application in question isn't a GUI-based program, it shows up the console by default.
How would I do that then? I have built the program fine I just want to get rid of that box, and I dont need to create another window.
What you want is a Windows service install.
That's a program that has no window.
For a list of yours:
Start >> Control Panel >> Administrative Tools >> Services.
And yes, there are programs designed to install a program, as a service. I'll have to refer you to Microsoft, but search for Windows service, and iirc, one program was srvany.exe.
There is another program that does about the same thing, but with a different way of handling the services it installs. Sorry, can't remember that name.
You're working with the registry here, so be *very* careful, make a backup first of the registry, and I'd review things like "checkpoints" as well, and how to go about using them, if need be.
Start >> run >> regedit, of course, is your registry editor.
It's been a while since I wrote anything on a Windows machine, but if I recall correctly you should just be able to replace your main() function with the WinMain function and Windows will believe that you're running a GUI application. Yeah, you won't have a 'proper' return value since you aren't handling any kind of callbacks, but if you return 0 when you exit it should work.
Not sure if it's any help, but Win2K onwards have FreeConsole which may do what you want.