[fpc-pascal] TSR Programs

Thomas Schatzl tom_at_work at gmx.at
Wed Mar 9 21:54:16 CET 2005


Hello,

Pianoman schrieb:
> Hello, how can I create resident programs for WIN32 in FPC?
> Any help or docs would be appreciated.
> Pianoman

There are no special "resident" programs anymore, simply create a normal 
GUI app with an invisible window or a service. See below for more info:

E.g.
Use {$APPTYPE GUI} and WS_POPUP in CreateWindow (which works in any 
Windows version) or create a message-only window (see 
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowfeatures.asp?frame=true#message_only 
on how to do this).

If you want it to run as service either use a tool to start the program 
as service (there should be freeware ones on the 'net, probably 
easiest), or try one of the following links for advice:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/services.asp
(if you want to do it yourself, it's basically a 
"tell-the-OS-that-you-really-want-to-do-this" type of task involving 
calling a few WinAPI functions with lots of parameters)

http://community.freepascal.org:10000/bboard/q-and-a-fetch-msg.tcl?msg_id=0001RC&topic_id=14&topic=Developing%20for%20Windows
(example could need some formatting =)

http://sourceforge.net/projects/wwwserver/ (some www server written in 
Delphi)

or

http://tothpaul.free.fr/zip/NTSERVICE.ZIP (some generic service code for 
Delphi, should work in FPC from a coarse look)

Regards,
   Thomas




More information about the fpc-pascal mailing list