I have made an .exe that estabilishes a IPC connection with a game (Microsoft CFS2), and reads some variables and writes some others. The problem is that I want my prog to stay resident, and do its routine every x seconds, instead of terminationg after it completes the routine. It should also leave control to the game in the meantime (when it's not performing its routine). How can I achieve this? Thanks all, Kefren
Posted on 2001-04-06 05:10:00 by kefren
You don't want your program to exit? Don't invoke ExitProcess :P Not so much a TSR, more an SR! If you want it to do some thing every X seconds, a Timer is what you will be after. Mirno
Posted on 2001-04-06 06:17:00 by Mirno
Wow! Said this way it seems to be easy! But...how do I make a timer? Thanks, Andrea
Posted on 2001-04-06 06:39:00 by kefren
Look in your API reference at SetTimer From the API:
The SetTimer function creates a timer with the specified time-out value.
When your done, remember to KillTimer! Mirno
Posted on 2001-04-06 07:09:00 by Mirno
Hi you can also use a modifyed message loop using PeekMessage instead of GetMessage and if there is no message from windows to process....do your thing :) this is the way games loop work usualy...much faster then a timer also :) to get even more complicated you can use a separated thread and adjust its speed with a Sleep() API call at the end of the loop
Posted on 2001-04-06 07:38:00 by BogdanOntanu
Hi, for a simple program with a timer and no window you can take a look at SaFc0n's Start-button-animator. You can find it on his site: Click me :) Maybe this helps. Stefan P.S. Make sure to comment out\remove the line

invoke DeleteObject,oldbmp          ;|> and delete that bitmap
because otherwise you will loose your original bitmap of your start-button until rebooting.
Posted on 2001-04-09 18:38:00 by Stefan Krause
This al is great! I will dig into all these suggestions! Thanx all! Now another bit of a problem: If I make a program with no window, can I put an icon on the system tray, near the clock? 'Bye, Kefren
Posted on 2001-04-11 11:39:00 by kefren
Look at Icz's tut 23 - "TrayIcon"... It was rather lucky Icz named it that, as it puts an item in the system tray! :P Mirno
Posted on 2001-04-11 13:25:00 by Mirno
Oh My! How could I be so silly not to see it?!?!? Thanx, and I'm sorry for bothering!!!
Posted on 2001-04-12 05:55:00 by kefren