Bonjour à tous et à toutes!!!
J'expose mon problmèe, je voudrais créer un servcie, qui affiche un notify icon, à partir duquel j'ai un prog à faire tourner, enfin bref revenons au problème.
Mon problème, c'est que pour que mon service puisse afficher le notifyicon, je dois aller dans outils d'administration et faire propriétés sur mon service, dans l'onglet connection cocher la case: Autoriser intéraction avec le bureau.
J'ai trouvé sur le net un bout de code, pour régler ce problème, mais je n'arrive pas a le traduire en VB.Net:
Si vous pouviez m'aider. Merci!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 // Here is where we set the bit on the value in the registry. // Grab the subkey to our service RegistryKey ckey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\WindowsService1",true); // Good to always do error checking! if(ckey != null) { // Ok now lets make sure the "Type" value is there, //and then do our bitwise operation on it. if(ckey.GetValue("Type") != null) { ckey.SetValue("Type", ((int)ckey.GetValue("Type") | 256)); } }
Partager