Hi,
I'm updating an IM client C app (for Windows XP) so that when a users screensaver comes on their presence state changes from online to away.
What I've done so far is add:
while(TRUE){
refreshAutoAway();
Sleep(1000);
}
to the end of the WinMain function.
This all does what I want until I exit the application, when the process remains running in windows task manager. If I remove this code the application closes cleanly.
So got a couple of queries - firstly, am I going about this in the 'right' way (ie is using sleep() the best thing to do in this case)? and secondly, how I can ensure my repeated call to the function closes correctly when the app is exited?
Just let me know if you need to see any more bits of the code.
Cheers & TIA,
Alex
ps. the last time I did anything with C was about 8 years ago at college - so please consider me a newbie! ;-)