The lower-level global mouse hook freezes when clicking on the title buttons

I am writing an add-in for IE. I need to close the modal dialog with an external click.

So far I have used WM_NCACTIVATE to receive these notifications, but it seems that on Windows 7 (IE8) I am not receiving this message (I work on low integrity and I checked it with spy ++; it seems to work when I running on high integrity - weird stuff).

I tried using a regular mouse hook for DeskBand UI thread. I get all mouse events except those that are outside the dialog box.

So, I switched to using the global low-level mouse hook (WH_MOUSE_LL). everything works fine, but for some very strange reason, I get 5-10 seconds of freezing when I click on any of the title buttons.

After some online research, I realized that this is a common problem, but I did not find a solution. some people talked about performance issues, but even if the Hook function only calls CallNextHook, it still happens.

Any ideas on how to fix this or alternative ideas to close the modal dialog with an external click?

Thanks a lot, Omer

+3
source share
3 answers

, WH_MOUSE_LL. Windows XP, , , .

, , . .

+1
0

. , , IE, ( IE Protected Mode). . , , IE, , , . , , . , , , . , / . , , .

: hook .

( , , . .)

Windows OK/Cancel/Dismiss. . , , , , , , , .

Windows, , (. SetCapture), , - . , , . , .

, . , , .

0

Source: https://habr.com/ru/post/1776084/


All Articles