For Programmers: Free Programming Magazines  


Home > Archive > Delphi > May 2004 > how do i make a service survive a log off in win98?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how do i make a service survive a log off in win98?
Dave

2004-04-05, 5:33 pm

Hi

I am writing a client app for Windows 98 that is run via a registry value in
'runservices', the code then registers itself as a service by calling the
registerserviceprocess. However, although the app is no longer displayed on
the taskmanager, it is still closed when a user logs off.

Can anyone explain what I need to do?

Thanks in advance
Dave


Marc Rohloff

2004-04-06, 9:53 am

"Dave" <deepthinkernospam@btinternet.com> wrote in message news:<c4sg2d$qs1$2@newsg4.svr.pol.co.uk>...

> I am writing a client app for Windows 98 that is run via a registry value in
> 'runservices', the code then registers itself as a service by calling the
> registerserviceprocess. However, although the app is no longer displayed on
> the taskmanager, it is still closed when a user logs off.


You probably need to provide an override of the WM_QUERYENDSESSION and
WM_ENDSESSION messages. Check the parameters, one of them should
indicate wether it is a logoff or a shutdown.

Marc
Ferruccio Barletta

2004-05-24, 11:44 am

Call RegisterServiceProcess(), it's a 9x API that tells the OS to treat a
process as a service, i.e. don't kill it on logoff. If I remember correctly,
you have to get its address by calling
GetProcAddress("RegisterServiceProcess") on kernel32.dll.

-- FGB

"Dave" <deepthinkernospam@btinternet.com> wrote in message
news:c4sg2d$qs1$2@newsg4.svr.pol.co.uk...
> Hi
>
> I am writing a client app for Windows 98 that is run via a registry value

in
> 'runservices', the code then registers itself as a service by calling the
> registerserviceprocess. However, although the app is no longer displayed

on
> the taskmanager, it is still closed when a user logs off.
>
> Can anyone explain what I need to do?
>
> Thanks in advance
> Dave
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com