diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 19:14:28 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 20:27:52 +0100 |
commit | de26ed225eb03ab36efed592774e460b21e695fa (patch) | |
tree | 8af766ee723d994b8a4412584229b2db987292b5 /svx/uiconfig/ui | |
parent | a21ec77601e2dd15a2281727b827db9310cece6d (diff) |
tdf#120703 PVS: V547 Fix activation of launched process' window
V547 Expression 'procHandle != nullptr' is always false.
The code was nonsensical overall. First, the launched process handle
was never returned by ShellExecuteExW, because SEE_MASK_NOCLOSEPROCESS
wasn't used, so GetProcessId couldn't succeed. Then, nullptr window
handle was passed to GetWindowThreadProcessId, thus never returning a
meaningful result.
This reimplements this to find the launched process' main window by
first waiting for process idle (up to 1-second delay is possible),
then enumerating all the top-level windows and checking their process.
Change-Id: I5fb4c04147b3f9414e27650a023f7844523c18bd
Reviewed-on: https://gerrit.libreoffice.org/62478
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx/uiconfig/ui')
0 files changed, 0 insertions, 0 deletions