1

I'm about to create a background process and I'm not sure what method i should use, my application will listen out for any new registry startup keys and display to the user whether they accept it or not. I'm thinking about using a form with no boarders and using the following code:

onWaitForm.ActiveForm.BackColor = Color.Transparent
onWaitForm.ActiveForm.Hide();
onWaitForm.ActiveForm.Visible = false;

which would make the form invisible, and i would use a Timer to check the registry for any new keys.

Also keeping in mind i wont to keep the applications footprint vary small, so is there any other options i could use maybe like a process that runs in the background and when it detects a registry key it will then open a form?

Daniel Jones
  • 109
  • 1
  • 2
  • 9
  • You don't need a form, you can simply start a thread watching on the registry. Did you read System.Thread documentation ? Btw, for watching the registry, polling is not the best way : http://stackoverflow.com/questions/826971/registry-watcher-c-sharp – C4stor Jul 18 '13 at 07:50
  • Can you please link me to any documentation or a example of a Thread process? – Daniel Jones Jul 18 '13 at 07:58

1 Answers1

0

Instead of using timer etc use WqlEventQuery along with ManagementEventWatcher of WMI.

Ehsan
  • 31,833
  • 6
  • 56
  • 65