Click here to Skip to main content
15,902,114 members
Home / Discussions / C#
   

C#

 
GeneralReceiving NoNullAllowedException setting SelectedValue from code. Pin
Brett Slaski22-Jul-04 12:01
Brett Slaski22-Jul-04 12:01 
GeneralRe: Receiving NoNullAllowedException setting SelectedValue from code. Pin
Heath Stewart22-Jul-04 12:11
protectorHeath Stewart22-Jul-04 12:11 
GeneralRe: Receiving NoNullAllowedException setting SelectedValue from code. Pin
Brett Slaski23-Jul-04 9:30
Brett Slaski23-Jul-04 9:30 
GeneralRe: Receiving NoNullAllowedException setting SelectedValue from code. Pin
Heath Stewart23-Jul-04 10:00
protectorHeath Stewart23-Jul-04 10:00 
Generalnon-static class referencing Pin
Wolfman3222-Jul-04 12:00
Wolfman3222-Jul-04 12:00 
GeneralRe: non-static class referencing Pin
Heath Stewart22-Jul-04 12:29
protectorHeath Stewart22-Jul-04 12:29 
Generalthe process and services... Pin
Wail A.Salem22-Jul-04 11:58
Wail A.Salem22-Jul-04 11:58 
GeneralRe: the process and services... Pin
Heath Stewart22-Jul-04 12:39
protectorHeath Stewart22-Jul-04 12:39 
Wail A.Salem wrote:
how we can prevent the user from ending the process from the task manager?

You can't. But you can respond to notification that a user is killing your process. Handle the Closing or Close event of your main form (the one you pass directly or indirectly to Application.Run). If your code is not finished in a timely manner, your process will be killed. There are a few other ways as well, but I'll leave this as an exercise for you. I recommend reading through the Windows Management APIs section of the MSDN Online Library[^].

As for the second question, you have to write this to the registry yourself. So add a registry key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\<YourServiceName>\Type such as 288 (256 for "Interact with desktop" OR'd with 32 for the service type), or whatever is appropriate for your service type so long as you perform a bitwise OR with 256 and run it as the LocalSystem (default). If you run it as a user, then the service can only interact with that user's desktop (assuming the user has an associated desktop session and can log in locally).

 

Microsoft MVP, Visual C#
My Articles
QuestionGetTextExtent? Pin
Matt Gerrans22-Jul-04 10:01
Matt Gerrans22-Jul-04 10:01 
AnswerRe: GetTextExtent? Pin
Gary Thom22-Jul-04 10:06
Gary Thom22-Jul-04 10:06 
GeneralRe: GetTextExtent? Pin
Matt Gerrans22-Jul-04 19:25
Matt Gerrans22-Jul-04 19:25 
GeneralRun external program and wait Pin
Boaz V22-Jul-04 9:06
Boaz V22-Jul-04 9:06 
GeneralRe: Run external program and wait Pin
Heath Stewart22-Jul-04 9:25
protectorHeath Stewart22-Jul-04 9:25 
GeneralAtt: Heath Stewart - Browser Helper Objects Pin
Stuggo22-Jul-04 8:46
Stuggo22-Jul-04 8:46 
GeneralRe: Att: Heath Stewart - Browser Helper Objects Pin
Heath Stewart22-Jul-04 9:08
protectorHeath Stewart22-Jul-04 9:08 
GeneralCOM Ports Pin
eggie522-Jul-04 7:09
eggie522-Jul-04 7:09 
GeneralRe: COM Ports Pin
eggie522-Jul-04 7:42
eggie522-Jul-04 7:42 
GeneralRe: COM Ports Pin
Jae Sammy22-Jul-04 7:51
Jae Sammy22-Jul-04 7:51 
GeneralRe: COM Ports Pin
eggie522-Jul-04 8:01
eggie522-Jul-04 8:01 
GeneralRe: COM Ports Pin
Jae Sammy23-Jul-04 4:17
Jae Sammy23-Jul-04 4:17 
GeneralListView ColumnHeader class Pin
Andy H22-Jul-04 6:12
Andy H22-Jul-04 6:12 
GeneralRe: ListView ColumnHeader class Pin
Heath Stewart22-Jul-04 9:31
protectorHeath Stewart22-Jul-04 9:31 
GeneralPDF ActiveX Control Pin
Mr. Rogers22-Jul-04 6:12
Mr. Rogers22-Jul-04 6:12 
GeneralHelp: SQL Update Pin
j1e1g122-Jul-04 5:28
j1e1g122-Jul-04 5:28 
GeneralRe: Help: SQL Update Pin
j1e1g122-Jul-04 5:35
j1e1g122-Jul-04 5:35 

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.