Changeset 742
- Timestamp:
- 12/6/2008 6:58:00 AM (4 years ago)
- Location:
- branches/eraser6
- Files:
-
- 3 edited
-
Eraser/Program.cs (modified) (1 diff)
-
Eraser/SettingsPanel.cs (modified) (2 diffs)
-
ShellExt/CtxMenu.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Eraser/Program.cs
r741 r742 803 803 804 804 /// <summary> 805 /// Gets or sets whether the Shell Extension should be loaded into Explorer. 806 /// </summary> 807 public bool IntegrateWithShell 808 { 809 get 810 { 811 return settings["IntegrateWithShell"] == null ? 812 true : (bool)settings["IntegrateWithShell"]; 813 } 814 set 815 { 816 settings["IntegrateWithShell"] = value; 817 } 818 } 819 820 /// <summary> 805 821 /// Gets or sets a value on whether the main frame should be minimised to the 806 822 /// system notification area. -
branches/eraser6/Eraser/SettingsPanel.cs
r636 r742 180 180 plausibleDeniabilityFiles.Items.Add(path); 181 181 182 uiContextMenu.Checked = settings.IntegrateWithShell; 182 183 lockedAllow.Checked = 183 184 ManagerLibrary.Instance.Settings.EraseLockedFilesOnRestart; … … 409 410 MessageBoxIcon.Information); 410 411 } 412 settings.IntegrateWithShell = uiContextMenu.Checked; 413 411 414 managerSettings.DefaultFileErasureMethod = 412 415 ((ErasureMethod)eraseFilesMethod.SelectedItem).GUID; -
branches/eraser6/ShellExt/CtxMenu.cpp
r736 r742 83 83 }; 84 84 85 Handle<HKEY>::~Handle() 86 { 87 CloseHandle(Object); 88 } 89 85 90 namespace Eraser { 86 91 HRESULT CCtxMenu::FinalConstruct() … … 91 96 MenuTitle = new wchar_t[menuTitle.length() + 1]; 92 97 wcscpy_s(MenuTitle, menuTitle.length() + 1, menuTitle.c_str()); 98 99 //Check if the shell extension has been disabled. 100 Handle<HKEY> eraserKey(NULL); 101 LONG openKeyResult = RegOpenKeyEx(HKEY_CURRENT_USER, 102 L"Software\\Eraser\\Eraser 6\\3460478d-ed1b-4ecc-96c9-2ca0e8500557\\", 0, 103 KEY_READ, &static_cast<HKEY&>(eraserKey)); 104 105 switch (openKeyResult) 106 { 107 case ERROR_FILE_NOT_FOUND: 108 //No settings defined: we default to enabling the shell extension. 109 return S_OK; 110 111 case ERROR_SUCCESS: 112 break; 113 114 default: 115 return E_FAIL; 116 } 117 118 //Check the value of the IntegrateWithShell value. 119 DWORD valueType; 120 BYTE valueBuffer[512]; 121 DWORD valueBufferSize = sizeof(valueBuffer); 122 DWORD error = RegQueryValueEx(eraserKey, L"IntegrateWithShell", NULL, &valueType, 123 valueBuffer, &valueBufferSize); 124 if (error == ERROR_SUCCESS) 125 { 126 if (!*reinterpret_cast<char*>(valueBuffer + 51)) 127 return E_FAIL; 128 } 93 129 94 130 return S_OK;
Note: See TracChangeset
for help on using the changeset viewer.
