Hi guys, thanx for the feedbacks.
I'm using CreateProcess(@appath, Nil, Nil, Nil, False, CREATE_NEW_CONSOLE, Nil, Nil, StartupInfo,ProcessInformation); -to start the second app.
I'll try to clarify the situation, so you can understand me completely. - I hope.
There is a navigation program, sold more than 100.000 here, in Hungary. A very useful, nice and clever navi app.
One of my friend has made a skin pack for it. It uses completely different, more beautiful, colorful bmps, sounds, etc.
The navi program stores these data in a zip file on the pda's storage card, called: data.zip.
To install the new skin pack, you have to replace this data.zip with the new one - its simple.
But. We don't want to give this pack for free, so we need some copy protection.
My idea was, that we will "corrupt" the data.zip (skinned version), so it isn't usable this way. One can't uncompress it, and of course, the navi program even can't start with it. Its completely useless in this corrupted state. (I've overwrote some bytes in the data.zip)
So we'll need a starter application, which will
1. "uncorrupt" the data.zip
2. start the navigation program
3. waits some seconds, till the navi program opens, reads, and closes the data.zip
4. corrupts the data.zip again
5. closes
The navi program stays alive, and works fine, noone will see, that my program works in background, and manipulates the data.zip.
I've tried TProcess, but the navi program won't start with it. I don't know why. Createprocess, wrote above, works fine, the navi prog starts, and my program waits some sec, and do his job.
But if I don't write Application.ProcessMessages while waiting, my program blocks the navi prog, it won't start - or very slow, and usualy stucks somewhere under initializing.
So I tried the trick above, to wait 1 second - processmessages - wait 1 sec - processmessages - and so on.
Now it works fine, but I've found this solution a bit... ugly. Not so perfect.
I've made a small sample app with form, and a TTimer on it. I've started the navi app, and set to timer to 10 seconds, and start it.
The navi app started fine, and after 10 seconds my TTimer has triggered, and corrupted the data.zip, and exited.
I need this solution, but I don't need a form. My app should work in background, invisible.
So. How can I add a TTimer to a non-form-based application?
Or. What else solution do you advise?
Thanx guys for the patience.