Information générale
Catégorie:
Fonctions Windows API
>It's possible to create a Service (EXE) -which is a Windows NT application that runs in the background when NT starts up- with VFP6?
Install the NT Resource Kit. It includes two programs (InstSrv and SrvAny). From the command line setup a new service. For example:
instsrv YOURSERVICENAME srvany.exe
Note the format:
[install server program (with path)] [name of your service] [srvany (with path)]
Once that's done you need to modify some registry settings. Start up RegEdit and find your new service(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services). Now you need to enter a new key for your service called "Parameters". In the Parameters key add the the following string values:
AppDirectory = "C:\...INSERTYOURPATHHERE..."
Application = "C:\...INSERTYOURPATHHERE...\...YOUREXE.EXE"
AppParameters = "ANY PARAMETERS YOU WANT TO PASS"
Next, shut down RegEdit, open the "Services" Control Panel and look for your service. Set your service to manual or automatic and start it.
Not sure if this is the easiest way but it does work. The SrvAny and registry stuff should be easy enough to script in InstallShield. InstallShield also includes a sample install for an NT service. I've never used it though.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement