MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / GetDetails

Method GetDetails

WinArk/WindowsView.cpp:319–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317}
318
319CString CWindowsView::GetDetails(const DataItem& item) const {
320 CString text;
321 switch (item.Type) {
322 case DataItemType::ProcessId:
323 {
324 DWORD pid = 0;
325 ::GetWindowThreadProcessId(m_SelectedHwnd, &pid);
326 return ProcessHelper::GetFullProcessName(pid);
327 }
328
329 case DataItemType::Text:
330 text.Format(L"Length: %d", m_SelectedHwnd.GetWindowTextLength());
331 break;
332
333 case DataItemType::Style: return WindowHelper::WindowStyleToString(m_SelectedHwnd);
334 case DataItemType::ClassStyle: return WindowHelper::ClassStyleToString(m_SelectedHwnd);
335 case DataItemType::ExtendedStyle: return WindowHelper::WindowStyleToString(m_SelectedHwnd);
336 case DataItemType::Rectangle:
337 if (m_SelectedHwnd.IsZoomed())
338 return L"Maximized";
339 if (m_SelectedHwnd.IsIconic())
340 return L"Minimized";
341 break;
342 case DataItemType::NextWindow: return GetWindowClassAndTitle(m_SelectedHwnd.GetWindow(GW_HWNDNEXT));
343 case DataItemType::PrevWindow: return GetWindowClassAndTitle(m_SelectedHwnd.GetWindow(GW_HWNDPREV));
344 case DataItemType::OwnerWindow: return GetWindowClassAndTitle(m_SelectedHwnd.GetWindow(GW_OWNER));
345 case DataItemType::ParentWindow: return GetWindowClassAndTitle(::GetAncestor(m_SelectedHwnd, GA_PARENT));
346 case DataItemType::FirstChildWindow: return GetWindowClassAndTitle(m_SelectedHwnd.GetWindow(GW_CHILD));
347 }
348 return text;
349}
350
351CString CWindowsView::GetWindowClassAndTitle(HWND hWnd) {
352 if (hWnd == nullptr || !::IsWindow(hWnd))

Callers 1

ParseTableEntryMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected