From ab9a212b8ddf4b10d291b22938057f6ff125ccca Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 23 May 2018 17:28:42 +0100 Subject: [PATCH] Update qprocessinfo to 0d591f19f17805d65ef4880c3fc51021523003df --- qrenderdoc/Code/qprocessinfo.cpp | 10 +++++++--- qrenderdoc/Code/qprocessinfo.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/qrenderdoc/Code/qprocessinfo.cpp b/qrenderdoc/Code/qprocessinfo.cpp index d6b867b0e..a15c16253 100644 --- a/qrenderdoc/Code/qprocessinfo.cpp +++ b/qrenderdoc/Code/qprocessinfo.cpp @@ -67,7 +67,7 @@ static BOOL CALLBACK fillWindowTitles(HWND hwnd, LPARAM lp) return TRUE; } -QProcessList QProcessInfo::enumerate() +QProcessList QProcessInfo::enumerate(bool includeWindowTitles) { QProcessList ret; @@ -88,6 +88,9 @@ QProcessList QProcessInfo::enumerate() } CloseHandle(h); + if(!includeWindowTitles) + return ret; + HMODULE user32 = LoadLibraryA("user32.dll"); if(user32) @@ -123,7 +126,7 @@ QProcessList QProcessInfo::enumerate() #include #include -QProcessList QProcessInfo::enumerate() +QProcessList QProcessInfo::enumerate(bool includeWindowTitles) { QProcessList ret; @@ -205,6 +208,7 @@ QProcessList QProcessInfo::enumerate() } } + if(includeWindowTitles) { // get a list of all windows. This is faster than searching with --pid // for every PID, and usually there will be fewer windows than PIDs. @@ -334,7 +338,7 @@ QProcessList QProcessInfo::enumerate() #else -QProcessList QProcessInfo::enumerate() +QProcessList QProcessInfo::enumerate(bool includeWindowTitles) { QProcessList ret; diff --git a/qrenderdoc/Code/qprocessinfo.h b/qrenderdoc/Code/qprocessinfo.h index 1ba7f47c2..b865f6a44 100644 --- a/qrenderdoc/Code/qprocessinfo.h +++ b/qrenderdoc/Code/qprocessinfo.h @@ -16,7 +16,7 @@ class QProcessInfo public: QProcessInfo(); - static QProcessList enumerate(); + static QProcessList enumerate(bool includeWindowTitles = true); uint32_t pid() const; void setPid(uint32_t pid);