| 111 | } |
| 112 | |
| 113 | BOOL CColorCopApp::GetShellFolderPath(LPCTSTR pShellFolder, LPTSTR pShellPath) { |
| 114 | // pShellFolder can be one of the following |
| 115 | // AppData, Cache, Cookies, Desktop, Favorites, Fonts, History, NetHood, |
| 116 | // Personal, Printhood, Programs, Recent, SendTo, Start Menu, Startup, |
| 117 | // Templates, ShellNew |
| 118 | DWORD rc; |
| 119 | DWORD length = MAX_PATH; |
| 120 | DWORD type = REG_SZ; |
| 121 | HKEY hkey; |
| 122 | |
| 123 | rc = RegOpenKeyEx(HKEY_CURRENT_USER, |
| 124 | _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"), |
| 125 | 0, KEY_READ, &hkey); |
| 126 | |
| 127 | if (rc == ERROR_SUCCESS) { |
| 128 | rc = RegQueryValueEx(hkey, pShellFolder, NULL, &type, |
| 129 | reinterpret_cast<BYTE*>(pShellPath), &length); |
| 130 | RegCloseKey(hkey); |
| 131 | } |
| 132 | |
| 133 | if (rc == ERROR_SUCCESS) { |
| 134 | return TRUE; |
| 135 | } else { |
| 136 | return FALSE; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | CString CColorCopApp::GetSettingsFolder() { |
| 141 | CString path; |
nothing calls this directly
no outgoing calls
no test coverage detected