smasherprog / screen_capture_lite

cross platform screen/window capturing library
MIT License
619 stars 156 forks source link

fix for freezing on getting current window text #52

Closed oktonion closed 6 years ago

oktonion commented 6 years ago

On Windows GetWindowTextA is simply SendMessage that is getting stuck on waiting for current process window to respond which will never happen obviously if the window is not created yet or is frozen by this code. The caller should know better own window title text so exclude own window titles in the enumeration process.

oktonion commented 6 years ago

It's simple - just ran 'GetWindows' function in GUI application, f.e. on form creation. GUI event loop is in the same thread as 'GetWindows' code and waiting for it to finish, so no response from current window to SendMessage, never.

smasherprog commented 6 years ago

Ahhh yeah that would make sense. Thanks for the PR!