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
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
Wow! Said this way it seems to be easy! But...how do I make a timer? Thanks, Andrea
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
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
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
because otherwise you will loose your original bitmap of your start-button until rebooting.
invoke DeleteObject,oldbmp ;|> and delete that bitmap
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
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
Oh My! How could I be so silly not to see it?!?!? Thanx, and I'm sorry for bothering!!!