Skip to content

Unable to cancel SendMessage when switching apps in some cases #3825

@nvaccessAuto

Description

@nvaccessAuto

Reported by jteh on 2014-01-28 08:57
We hook SendMessage and SendMessageTimeout so that we can cancel them from watchdog. The hook uses SendMessageTimeout in a loop with a pretty short timeout. Unfortunately, it seems that SendMessageTimeout blocks until the window responds when switching apps in some cases, regardless of the timeout. SMTO_BLOCK fixes this, but it also breaks PowerPoint (#2900). I guess it gets stuck handling some sort of nonqueued message, but I can't see that in the stack.

Str:

  1. Find an app that you can cause to freeze on demand. A manufactured test case is probably easiest. :)
  2. Open that app and Notepad++.
  3. Ensure you can switch from the freezing app to Notepad++ with one keystroke; e.g. fiddle with the alt+tab order.
  4. Cause the freeze.
  5. Switch to Notepad++.
    Watchdog can't recover from this freeze, no matter how hard it tries.

We can get around this by running SendMessageTimeout in a background thread.
Blocked by #3801, #3859

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions