MCPcopy Create free account
hub / github.com/ColorCop/ColorCop / OnDestroy

Method OnDestroy

ColorCop/ColorCopDlg.cpp:2246–2273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2244}
2245
2246void CColorCopDlg::OnDestroy() {
2247 // Capture and store the dialog’s last on-screen position so it can be
2248 // restored the next time the application starts.
2249 RECT winSize{};
2250 GetWindowRect(&winSize);
2251 WinLocX = winSize.left;
2252 WinLocY = winSize.top;
2253
2254 // save the bitmap
2255 auto* pApp = static_cast<CColorCopApp*>(AfxGetApp());
2256 CString strBMPFile = pApp->GetSettingsFolder();
2257 strBMPFile += BMP_FILE;
2258
2259 TRACE(_T("Portable mode: %d\n"), m_PortableMode);
2260 TRACE(_T("BMP path: %s\n"), strBMPFile.GetString());
2261
2262 HWND curwindowhwnd = ::GetForegroundWindow();
2263
2264 if (hBitmap) {
2265 PBITMAPINFO MagBmpInfo = CreateBitmapInfoStruct(curwindowhwnd, hBitmap);
2266 CreateBMPFile(curwindowhwnd, strBMPFile.GetBuffer(MAX_PATH), MagBmpInfo, hBitmap, ::GetDC(NULL));
2267
2268 strBMPFile.ReleaseBuffer();
2269 }
2270
2271 CDialog::OnDestroy();
2272 return;
2273}
2274
2275void CColorCopDlg::OnFileExit() {
2276 EndDialog(IDOK);

Callers

nothing calls this directly

Calls 1

GetSettingsFolderMethod · 0.80

Tested by

no test coverage detected