diff --git a/DebugView++/DebugView++.cpp b/DebugView++/DebugView++.cpp index f46058c7..e5bd309b 100644 --- a/DebugView++/DebugView++.cpp +++ b/DebugView++/DebugView++.cpp @@ -131,6 +131,7 @@ int Main(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPWSTR /*lpstrCmdLine auto args = Win32::GetCommandLineArguments(); std::wstring fileName; + std::wstring selectTabName; for (size_t i = 1; i < args.size(); ++i) { @@ -143,6 +144,10 @@ int Main(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPWSTR /*lpstrCmdLine //wndMain.SetLogging(); // todo: implement: FileWriter needs to concurrently access m_logfile, it now causes a crash if DbgMsgSrc -1 is run // this should be replaced by the new streaming-to-disk feature we discussed. } + else if (boost::icontains(args[i], L"/tab:")) + { + selectTabName = args[i].substr(std::wstring(L"/tabs:").length() - 1, args[i].length()); + } else if (args[i][0] != '/') { if (!fileName.empty()) @@ -175,7 +180,10 @@ int Main(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPWSTR /*lpstrCmdLine { wndMain.CapturePipe(hPipe); } - + if (!selectTabName.empty()) + { + wndMain.SetSelectTabByName(selectTabName); + } return theLoop.Run(); } diff --git a/DebugView++/MainFrame.cpp b/DebugView++/MainFrame.cpp index b2597f2f..8f03ecd1 100644 --- a/DebugView++/MainFrame.cpp +++ b/DebugView++/MainFrame.cpp @@ -93,7 +93,7 @@ std::wstring FormatDuration(double seconds) return wstringbuilder() << FormatUnits(minutes, L"minute") << L" " << FormatUnits(FloorTo(seconds), L"second"); } - static const wchar_t* units[] = {L"s", L"ms", L"µs", L"ns", nullptr}; + static const wchar_t* units[] = {L"s", L"ms", L"ï½µs", L"ns", nullptr}; const wchar_t** unit = units; while (*unit != nullptr && seconds > 0 && seconds < 1) { @@ -1182,6 +1182,19 @@ void CMainFrame::Load(std::istream& file, const std::string& name, FILETIME file } } +void CMainFrame::SetSelectTabByName(const std::wstring tabName) +{ + int views = GetViewCount(); + for (int i = 0; i < views; ++i) + { + if (GetView(i).GetName() == tabName) + { + GetTabCtrl().SetCurSel(i); + break; + } + } +} + void CMainFrame::CapturePipe(HANDLE hPipe) { m_logSources.AddPipeReader(Win32::GetParentProcessId(), hPipe); diff --git a/DebugView++/MainFrame.h b/DebugView++/MainFrame.h index 1675f32c..2127b0d5 100644 --- a/DebugView++/MainFrame.h +++ b/DebugView++/MainFrame.h @@ -90,6 +90,7 @@ class CMainFrame : public CTabbedFrameImpl