NT Service showing icon in systray

I have a problem. How a service can interact with desktop and install
icon in system tray. Here are the functions that are used to allow a service
to interact with desktop. I got them from a service complied file. The
Service shows an icon in the system tray. It uses following function in this
order.

getprocesswindowstation
openwindowstation
setprocesswindowstation
opendesktop
setthreaddesktop
getdesktopwindow

I think possibly using the handle from getdesktopwindow it install an icon
in system tray. but i was not sucessful. It even catches logon and logoff
events and continue to show icon again after logoff.

I will be very grateful if someone could guide me in this regard.

With Kindest regards,

Shrishail Rana


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

As a good rule, never use the interact with desktop flag and never tyr
to use Gui or MFC in a service.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shrishail Rana
Sent: Sunday, December 16, 2001 8:26 AM
To: NT Developers Interest List
Subject: [ntdev] NT Service showing icon in systray

I have a problem. How a service can interact with desktop and install
icon in system tray. Here are the functions that are used to allow a
service to interact with desktop. I got them from a service complied
file. The Service shows an icon in the system tray. It uses following
function in this order.

getprocesswindowstation
openwindowstation
setprocesswindowstation
opendesktop
setthreaddesktop
getdesktopwindow

I think possibly using the handle from getdesktopwindow it install an
icon in system tray. but i was not sucessful. It even catches logon and
logoff events and continue to show icon again after logoff.

I will be very grateful if someone could guide me in this regard.

With Kindest regards,

Shrishail Rana


You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I’d agree with JK’s opinion, not having a service interact with the desktop
is an especially good idea as of WindowsXP (and Terminal Services). In
WinXP Pro, you can have multiple interactive sessions, so WHICH desktop
should the service interact with.

I think a much better architecture is to have a service, and ALSO have an
interactive UI application that talks to the service through some
appropriate communication channel (like TCP/IP, or if memory serves me, a
COM singleton object). If you want, the UI app can be in the system tray of
the local machine.

Isn’t the MMC plug in architecture how UI’s for services are really
supposed to be designed now?

  • Jan

As a good rule, never use the interact with desktop flag and never tyr
to use Gui or MFC in a service.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shrishail Rana
Sent: Sunday, December 16, 2001 8:26 AM
To: NT Developers Interest List
Subject: [ntdev] NT Service showing icon in systray

I have a problem. How a service can interact with desktop and install
icon in system tray. Here are the functions that are used to allow a
service to interact with desktop. I got them from a service complied
file. The Service shows an icon in the system tray. It uses following
function in this order.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

>Isn’t the MMC plug in architecture how UI’s for services are really

supposed to be designed now?

Yes.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Jan Bottorff
Sent: Sunday, December 16, 2001 11:15 AM
To: NT Developers Interest List
Subject: [ntdev] RE: NT Service showing icon in systray

I’d agree with JK’s opinion, not having a service interact with the desktop
is an especially good idea as of WindowsXP (and Terminal Services). In
WinXP Pro, you can have multiple interactive sessions, so WHICH desktop
should the service interact with.

I think a much better architecture is to have a service, and ALSO have an
interactive UI application that talks to the service through some
appropriate communication channel (like TCP/IP, or if memory serves me, a
COM singleton object). If you want, the UI app can be in the system tray of
the local machine.

Isn’t the MMC plug in architecture how UI’s for services are really
supposed to be designed now?

  • Jan

As a good rule, never use the interact with desktop flag and never tyr
to use Gui or MFC in a service.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shrishail Rana
Sent: Sunday, December 16, 2001 8:26 AM
To: NT Developers Interest List
Subject: [ntdev] NT Service showing icon in systray

I have a problem. How a service can interact with desktop and install
icon in system tray. Here are the functions that are used to allow a
service to interact with desktop. I got them from a service complied
file. The Service shows an icon in the system tray. It uses following
function in this order.


You are currently subscribed to ntdev as: xxxxx@youngendeavors.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

GUIless parts of the MFC are OK - like CString or COM support.

Max

----- Original Message -----
From: “Jamey Kirby”
To: “NT Developers Interest List”
Sent: Saturday, December 15, 2001 8:10 PM
Subject: [ntdev] RE: NT Service showing icon in systray

> As a good rule, never use the interact with desktop flag and never tyr
> to use Gui or MFC in a service.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Shrishail Rana
> Sent: Sunday, December 16, 2001 8:26 AM
> To: NT Developers Interest List
> Subject: [ntdev] NT Service showing icon in systray
>
>
> I have a problem. How a service can interact with desktop and install
> icon in system tray. Here are the functions that are used to allow a
> service to interact with desktop. I got them from a service complied
> file. The Service shows an icon in the system tray. It uses following
> function in this order.
>
> getprocesswindowstation
> openwindowstation
> setprocesswindowstation
> opendesktop
> setthreaddesktop
> getdesktopwindow
>
> I think possibly using the handle from getdesktopwindow it install an
> icon in system tray. but i was not sucessful. It even catches logon and
> logoff events and continue to show icon again after logoff.
>
> I will be very grateful if someone could guide me in this regard.
>
>
> With Kindest regards,
>
> Shrishail Rana
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> appropriate communication channel (like TCP/IP, or if memory serves me, a

COM singleton object).

Yes, COM is the best in terms of complexity - use the ATL wizard and all will be fine.
This also gives the ability of managing the service over the network.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hello,

Ok I can start an application to monitor the service. But how to start the
application
just when a service start i.e. catch logoff and logon event.

With Kindest regards,

Shrishail Rana

Subject: RE: NT Service showing icon in systray
From: “Jamey Kirby”
Date: Sat, 15 Dec 2001 09:10:50 -0800
X-Message-Number: 3

As a good rule, never use the interact with desktop flag and never tyr
to use Gui or MFC in a service.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Shrishail Rana
Sent: Sunday, December 16, 2001 8:26 AM
To: NT Developers Interest List
Subject: [ntdev] NT Service showing icon in systray

I have a problem. How a service can interact with desktop and install
icon in system tray. Here are the functions that are used to allow a
service to interact with desktop. I got them from a service complied
file. The Service shows an icon in the system tray. It uses following
function in this order.

getprocesswindowstation
openwindowstation
setprocesswindowstation
opendesktop
setthreaddesktop
getdesktopwindow

I think possibly using the handle from getdesktopwindow it install an
icon in system tray. but i was not sucessful. It even catches logon and
logoff events and continue to show icon again after logoff.

I will be very grateful if someone could guide me in this regard.

With Kindest regards,

Shrishail Rana


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hello,

Ok I can start an application to monitor the service. But how to start the
application just when a service start i.e. catch logoff and logon event.

With Kindest regards,
Shrishail Rana

Subject: RE: NT Service showing icon in systray

From: “Jamey Kirby”
> Date: Sat, 15 Dec 2001 09:10:50 -0800
> X-Message-Number: 3
>
> As a good rule, never use the interact with desktop flag and never tyr
> to use Gui or MFC in a service.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Shrishail Rana
> Sent: Sunday, December 16, 2001 8:26 AM
> To: NT Developers Interest List
> Subject: [ntdev] NT Service showing icon in systray
>
>
> I have a problem. How a service can interact with desktop and install
> icon in system tray. Here are the functions that are used to allow a
> service to interact with desktop. I got them from a service complied
> file. The Service shows an icon in the system tray. It uses following
> function in this order.
>
> getprocesswindowstation
> openwindowstation
> setprocesswindowstation
> opendesktop
> setthreaddesktop
> getdesktopwindow
>
> I think possibly using the handle from getdesktopwindow it install an
> icon in system tray. but i was not sucessful. It even catches logon and
> logoff events and continue to show icon again after logoff.
>
> I will be very grateful if someone could guide me in this regard.
>
>
> With Kindest regards,
>
> Shrishail Rana
>
>
>
>
>
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com