windows service interact with the desktop

Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2007
Posts: 84
Reputation: knowledgelover is an unknown quantity at this point 
Solved Threads: 0
knowledgelover knowledgelover is offline Offline
Junior Poster in Training

windows service interact with the desktop

 
0
  #1
Mar 25th, 2008
Hi there,
I have written a windows service using C#, but as the default case it does not interact with the desktop, that property which I need can be modified from the registry key , I had this code in the afterinstall for the Service installer:
  1. private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
  2. {
  3. RegistryKey ckey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\nServiceName",true);
  4. if (ckey != null)
  5. {
  6.  
  7. if (ckey.GetValue("Type") != null)
  8. {
  9. ckey.SetValue("Type", ((int)ckey.GetValue("Type") | 256));
  10.  
  11. }
  12. }
  13. }


It is supposed to change the key value(type) to the value 272(which is the value of that property ), actually it does , and the property of interact with the desktop is activated, but the application never show up on the desktop it just run the process (I saw it in the task manager)


if anybody hopefully has an answer on what should else I do, please your help is needed!
there's always something to learn
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 84
Reputation: knowledgelover is an unknown quantity at this point 
Solved Threads: 0
knowledgelover knowledgelover is offline Offline
Junior Poster in Training

Re: windows service interact with the desktop

 
0
  #2
Mar 26th, 2008
Any help please ,

Thanks in advance
there's always something to learn
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum


Views: 3850 | Replies: 1
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC