Skip to content

Commit

Permalink
Merge pull request #52 from oktonion/master
Browse files Browse the repository at this point in the history
fix for freezing on getting current window text
  • Loading branch information
smasherprog authored May 8, 2018
2 parents 3f77ef9 + ec23b44 commit b273b0e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/windows/GetWindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ namespace Screen_Capture {
{
Window w;
char buffer[sizeof(w.Name)];
GetWindowTextA(hwnd, buffer, sizeof(buffer));
{ // exclude windows for current process
DWORD pid;
GetWindowThreadProcessId(hwnd, &pid);
if (pid != GetProcessId(GetCurrentProcess()))
{
GetWindowTextA(hwnd, buffer, sizeof(buffer));
}
}
srch *s = (srch *)lParam;
std::string name = buffer;
w.Handle = reinterpret_cast<size_t>(hwnd);
Expand Down

0 comments on commit b273b0e

Please sign in to comment.