Click to See Complete Forum and Search --> : Taksbar icon in XP service
mkapusta
April 17th, 2003, 10:20 AM
I've written Windows XP service which shows icon on taskbar.
It works fine when only one user is logged on (icon is visible),
but when another user is logged on, than icon is not visible for
him (icon is visible only for the first logged user). I detect the
user swich by WM_WTSSESSION_CHANGE message, but after
discovering user swich when I call Shell_NotifyIcon(NIM_ADD,&tnid) the icon is not visible. How can I do this?
Anybody can help me, thanks in advance.
Best regards
mahanare
April 18th, 2003, 04:52 AM
I too observed this with some other service.
It may be a windows property, or because it was started when the first user logged in so,it might be invisible to other users.
What I feel is when the first user logs off then, the service will not be stopped (it will be running until a shutdown or an explicit stop) so it may not be visible to other users.
IDEAS:
have you tried to login with the same first user id, is it visible to you now, if yes my reason may be correct.
But any how try with all possible ways to make your system tray icon visible.
one option is when you detect the windows user change then stop the service and start it again, is it possible?
cheers
mahanare
mkapusta
April 18th, 2003, 08:18 AM
Thank you for your response.
Unfortunately I can’t restart the service when I detect user switch, because it’s a system service, which starts automatically, and should be still running.
I discovered that icon is visible always for the first user which is logged on. When the first users logged off and after this another user will log on, he will also see the icon.
In MSDN I found that service must duplicate its primary process token and change the session identifier to the current session identifier. The current session identifier can be obtained by using WTSGetActiveConsoleSessionID(), but how can I change the session id. Could you help me?
Best regards
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.