Click here to Skip to main content
16,004,901 members
Home / Discussions / C#
   

C#

 
GeneralRe: API Call to GetProfileString Does Not Fill Buffer Pin
stoked15-Nov-04 7:51
stoked15-Nov-04 7:51 
GeneralRe: API Call to GetProfileString Does Not Fill Buffer Pin
Heath Stewart15-Nov-04 8:02
protectorHeath Stewart15-Nov-04 8:02 
GeneralRe: API Call to GetProfileString Does Not Fill Buffer Pin
stoked15-Nov-04 8:24
stoked15-Nov-04 8:24 
GeneralRe: API Call to GetProfileString Does Not Fill Buffer Pin
Heath Stewart15-Nov-04 9:09
protectorHeath Stewart15-Nov-04 9:09 
GeneralRe: API Call to GetProfileString Does Not Fill Buffer Pin
stoked15-Nov-04 10:51
stoked15-Nov-04 10:51 
GeneralRe: API Call to GetProfileString Does Not Fill Buffer Pin
stoked15-Nov-04 8:03
stoked15-Nov-04 8:03 
General.Net Service & Notifyicon disappearing after log-off/log-on Pin
Steef (Stephan Deckers)15-Nov-04 6:07
Steef (Stephan Deckers)15-Nov-04 6:07 
GeneralRe: .Net Service & Notifyicon disappearing after log-off/log-on Pin
Heath Stewart15-Nov-04 6:45
protectorHeath Stewart15-Nov-04 6:45 
Without any details or code snippets, it's almost impossible to tell you anything. However, it appears that you're assuming the service is stopped when you log off and started when you log on. That's not the case. Services were created to run before credentials are even required of an interactive user and have nothing to do with whether a user is logged on or off (even if you run the service as an interactive user, a separate window station is created in order to run the service; allowing the service to interact with the desktop interacts with the current interactive user account).

Your evidence also supports that: if you stop and restart the service your icon is back. If you log off and back on, it's not there. When you logged off the service wasn't stopped (it is run by the service control manager (SCM), not the Windows shell).

You should consider creating a separate control panel application that is started from HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run or the [All Users]\Start menu\Programs\Startup folder. This would interact with the service through .NET Remoting (recommended for .NET applications) or some other IPC. You can also send custom commands (see ServiceController.ExecuteCommand and ServiceBase.OnCustomCommand) to communicate with your service, but you'll limited to a simple int, requiring that you create your own protocol for controlling your service (it is much easier than .NET Remoting or IPC, however, if all you need to do is send simple commands to perform some routine).

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: .Net Service & Notifyicon disappearing after log-off/log-on Pin
Steef (Stephan Deckers)15-Nov-04 8:48
Steef (Stephan Deckers)15-Nov-04 8:48 
GeneralDatetime : Minutes between two date values Pin
Anonymous15-Nov-04 2:42
Anonymous15-Nov-04 2:42 
GeneralRe: Datetime : Minutes between two date values Pin
turbochimp15-Nov-04 3:07
turbochimp15-Nov-04 3:07 
GeneralRe: Datetime : Minutes between two date values Pin
Heath Stewart15-Nov-04 5:50
protectorHeath Stewart15-Nov-04 5:50 
GeneralRe: Datetime : Minutes between two date values Pin
turbochimp15-Nov-04 6:03
turbochimp15-Nov-04 6:03 
GeneralRe: Datetime : Minutes between two date values Pin
Stefan Troschuetz15-Nov-04 3:11
Stefan Troschuetz15-Nov-04 3:11 
GeneralInherited User Control: "System.NullReference" Pin
Jannigje15-Nov-04 2:06
Jannigje15-Nov-04 2:06 
GeneralRe: Inherited User Control: "System.NullReference" Pin
turbochimp15-Nov-04 3:13
turbochimp15-Nov-04 3:13 
GeneralRe: Inherited User Control: "System.NullReference" Pin
Jannigje15-Nov-04 3:42
Jannigje15-Nov-04 3:42 
GeneralRe: Inherited User Control: "System.NullReference" Pin
Skynyrd15-Nov-04 6:49
Skynyrd15-Nov-04 6:49 
Generalabout appbar icon Pin
oldhawkiu15-Nov-04 0:05
oldhawkiu15-Nov-04 0:05 
GeneralRe: about appbar icon Pin
Jannigje15-Nov-04 2:13
Jannigje15-Nov-04 2:13 
GeneralRe: about appbar icon Pin
oldhawkiu15-Nov-04 13:58
oldhawkiu15-Nov-04 13:58 
GeneralRe: about appbar icon Pin
Jannigje15-Nov-04 20:24
Jannigje15-Nov-04 20:24 
GeneralPress Esc to cancel editing in TextBox and return to column's value Pin
god4k14-Nov-04 23:14
god4k14-Nov-04 23:14 
GeneralRe: Press Esc to cancel editing in TextBox and return to column's value Pin
..Hubert..15-Nov-04 1:01
..Hubert..15-Nov-04 1:01 
GeneralINCLUDES Pin
Brendan Vogt14-Nov-04 22:52
Brendan Vogt14-Nov-04 22:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.