| 654 | } |
| 655 | |
| 656 | void CMainFrame::SaveSettings() |
| 657 | { |
| 658 | auto mutex = Win32::CreateMutex(nullptr, false, L"Local\\DebugView++"); |
| 659 | Win32::MutexLock lock(mutex.get()); |
| 660 | |
| 661 | auto placement = Win32::GetWindowPlacement(*this); |
| 662 | |
| 663 | CRegKey reg; |
| 664 | reg.Create(HKEY_CURRENT_USER, RegistryPath); |
| 665 | reg.SetDWORDValue(L"X", placement.rcNormalPosition.left); |
| 666 | reg.SetDWORDValue(L"Y", placement.rcNormalPosition.top); |
| 667 | reg.SetDWORDValue(L"Width", placement.rcNormalPosition.right - placement.rcNormalPosition.left); |
| 668 | reg.SetDWORDValue(L"Height", placement.rcNormalPosition.bottom - placement.rcNormalPosition.top); |
| 669 | |
| 670 | reg.SetDWORDValue(L"LinkViews", m_linkViews); |
| 671 | reg.SetDWORDValue(L"AutoNewLine", m_logSources.GetAutoNewLine()); |
| 672 | reg.SetDWORDValue(L"AlwaysOnTop", GetAlwaysOnTop()); |
| 673 | reg.SetDWORDValue(L"Hide", m_hide); |
| 674 | |
| 675 | reg.SetStringValue(L"FontName", m_logfont.lfFaceName); |
| 676 | reg.SetDWORDValue(L"FontSize", LogFontSizeToPointSize(m_logfont.lfHeight)); |
| 677 | |
| 678 | reg.RecurseDeleteKey(L"Views"); |
| 679 | |
| 680 | CRegKey regViews; |
| 681 | regViews.Create(reg, L"Views"); |
| 682 | regViews.SetDWORDValue(L"Current", GetTabCtrl().GetCurSel()); |
| 683 | |
| 684 | int views = GetViewCount(); |
| 685 | for (int i = 0; i < views; ++i) |
| 686 | { |
| 687 | CRegKey regView; |
| 688 | regView.Create(regViews, WStr(wstringbuilder() << L"View" << i)); |
| 689 | regView.SetStringValue(L"", GetView(i).GetName().c_str()); |
| 690 | GetView(i).SaveSettings(regView); |
| 691 | } |
| 692 | |
| 693 | CRegKey regColors; |
| 694 | regColors.Create(reg, L"Colors"); |
| 695 | auto colors = ColorDialog::GetCustomColors(); |
| 696 | for (int i = 0; i < 16; ++i) |
| 697 | regColors.SetDWORDValue(WStr(wstringbuilder() << L"Color" << i), colors[i]); |
| 698 | } |
| 699 | |
| 700 | void CMainFrame::FindNext(const std::wstring& text) |
| 701 | { |
nothing calls this directly
no test coverage detected