void GetCurrentParamsPath(TSTRING &tsPath) { RegistryKey Key; if (!Key.Create(FURR_ROOTREGISTRYKEY, FURR_REGISTRYCONFIGSPATH)) { MessageBox(GetForegroundWindow(), _T("Failed to open registry key that contains current image parameters file path;") _T(" reverting to defaults."), _T("FURR - Error"), MB_OK | MB_ICONSTOP); GetAppPath(tsPath); tsPath += FURR_DEFIMAGEPARAMSFILE; } if (!Key.ReadString(FURR_CURIMAGEPARAMSVALUE, tsPath)) { MessageBox(GetForegroundWindow(), _T("Failed to read registry key that contains current image parameters file path;") _T(" reverting to defaults."), _T("FURR - Error"), MB_OK | MB_ICONSTOP); GetAppPath(tsPath); tsPath += FURR_DEFIMAGEPARAMSFILE; } if (_T("") == tsPath) { MessageBox(GetForegroundWindow(), _T("No current image parameters file is saved in the registry; reverting to defaults."), _T("FURR - Information"), MB_OK | MB_ICONINFORMATION); GetAppPath(tsPath); tsPath += FURR_DEFIMAGEPARAMSFILE; } }
void GetCurrentPreviewImage(TSTRING &tsImgPath) { RegistryKey Key; if (!Key.Create(FURR_ROOTREGISTRYKEY, FURR_REGISTRYCONFIGSPATH)) { MessageBox(GetForegroundWindow(), _T("Failed to open registry key that contains current preview image path!"), _T("FURR - Error"), MB_OK | MB_ICONSTOP); } Key.ReadString(FURR_CURPREVIEWIMAGEVALUE, tsImgPath); }