1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
 
namespace TrayIconRepair
{
    class Program
    {
        static void Main(string[] args)
        {
            string sTemp = DeleteTrayIconRegistry();
            Console.WriteLine("Register clear {0}", sTemp);
            System.Threading.Thread.Sleep(1000);        
        }
        
        public static void WriteRegistry(string _name, string _value)
        {
            RegistryKey regKey = Registry.CurrentUser.CreateSubKey("Software\\Test", RegistryKeyPermissionCheck.ReadWriteSubTree);
            regKey.SetValue(_name, _value, RegistryValueKind.String);
        }
 
 
        public static string ReadRegistry(string _name)
        {
            RegistryKey reg = Registry.CurrentUser;
            reg = reg.OpenSubKey("Software\\Test"true);
            if (reg == nullreturn "";
 
            if (null != reg.GetValue(_name))
            {
                return Convert.ToString(reg.GetValue(_name));
            }
            else
            {     
                return "";
            }
        }
 
        public static void DeleteRegistry()
        {
            Registry.CurrentUser.DeleteSubKey("Software\\Test");
        }
 
        public static string DeleteTrayIconRegistry()
        {
            RegistryKey reg = Registry.CurrentUser.OpenSubKey("Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\CurrentVersion\\Traynotify"true);
 
            if (reg == nullreturn "fail!";
 
            reg.DeleteValue("IconStreams"false);
            reg.DeleteValue("PastIconsStream"false);
 
            return "ok!";
        } 
 
    }

 

 }

cs

 

 

 

Windows7 버전에서 아이콘이 사라져 안보일때가 있다.

이때.. 사용할 소스코드.

 

 

Posted by +깡통+
이전버튼 1 2 3 4 5 이전버튼