質問編集履歴

1

typo

2017/04/06 11:06

投稿

cancat
cancat

スコア313

test CHANGED
File without changes
test CHANGED
@@ -28,80 +28,6 @@
28
28
 
29
29
  ```C#
30
30
 
31
- public static string clsid = @"CLSID\{ac3c2d9b-326d-4fea-ad53-ae22f8642813}";
32
-
33
- public void RegistFolder2PC() {
34
-
35
- string path=@"c:\myfolder";
36
-
37
- var rootkey = Microsoft.Win32.RegistryKey.OpenBaseKey(RegistryHive.ClassesRoot, RegistryView.Registry64);
38
-
39
-
40
-
41
- var RegistryKey = rootkey.CreateSubKey(clsid);
42
-
43
- RegistryKey.SetValue(null, "myApplication");
44
-
45
- RegistryKey.SetValue("DescriptionID", 3);
46
-
47
- RegistryKey.SetValue("Infotip", "myApplication", Microsoft.Win32.RegistryValueKind.ExpandString);
48
-
49
- RegistryKey.SetValue("SortOrderIndex", 48);
50
-
51
- RegistryKey.SetValue("System.IsPinnedToNameSpaceTree", 1);
52
-
53
- RegistryKey.Close();
54
-
55
-
56
-
57
- var RegistryKey1 = rootkey.CreateSubKey(clsid + @"\DefaultIcon");
58
-
59
- string iconpath =@"c:\myfolder.ico";
60
-
61
- RegistryKey1.SetValue(null, iconpath,Microsoft.Win32.RegistryValueKind.ExpandString);
62
-
63
- RegistryKey1.Close();
64
-
65
-
66
-
67
- var RegistryKey2 = rootkey.CreateSubKey(clsid + @"\InProcServer32");
68
-
69
- RegistryKey2.SetValue(null, @"%systemroot%system32\shell32.dll",Microsoft.Win32.RegistryValueKind.ExpandString);
70
-
71
- RegistryKey2.SetValue("ThreadingModel", "Both");
72
-
73
- RegistryKey2.Close();
74
-
75
- var RegistryKey3 = rootkey.CreateSubKey(clsid + @"\Instance");
76
-
77
- RegistryKey3.SetValue("CLSID", "{0E5AAE11-A475-4c5b-AB00-C66DE400274E}");
78
-
79
- RegistryKey3.Close();
80
-
81
- var RegistryKey4 = rootkey.CreateSubKey(clsid + @"\Instance\InitPropertyBag");
82
-
83
- RegistryKey4.SetValue("Attributes", 17);
84
-
85
- RegistryKey4.SetValue("TargetFolderPath" , path);
86
-
87
- RegistryKey4.Close();
88
-
89
- var RegistryKey5 = rootkey.CreateSubKey(clsid + @"\ShellFolder");
90
-
91
- Int32 writedata = BitConverter.ToInt32(BitConverter.GetBytes(0xf080004d), 0);
92
-
93
- RegistryKey5.SetValue("Attributes", writedata, Microsoft.Win32.RegistryValueKind.DWord);
94
-
95
- RegistryKey5.SetValue("FolderValueFlags", 0x00000029);
96
-
97
- RegistryKey5.SetValue("SortOrderIndex", 0);
98
-
99
- RegistryKey5.Close();
100
-
101
- }
102
-
103
- }
104
-
105
31
  ```
106
32
 
107
33