Hooks for events in C ++

I am trying to understand event hooks in C ++. I know what an event is, I used a lot of them in Java, C # and Javascript.

I am having problems finding documentation and tutorials on materials such as global interceptors, dll injections, global interceptors without a DLL.

Let's say that I wanted to iterate through the tabis browser in FireFox .. Do I need to hope that FireFox has an API for C ++? Or let's say that I wanted to do something, when the user opens a new tab, will I need to use the hook that FireFox will provide in its API?

The above is just an example, so people know what I'm trying to learn / understand. Am I thinking on the right track?

I saw a message on the forum and have been interested in the last 2 hours. I always say that a complex challenge, or a new challenge, makes a stronger programmer.

Any resources or any help would be greatly appreciated.

+1
source share
3 answers

C ++ itself has no events or hooks, but many C ++ libraries and frameworks implement them. For an example of a shared event library, see Boost.Signals .

Some of the implementations allow other applications to see their events, but the API is application specific (for example, for Firefox, see XPCOM ).


Windows , . , ++. , Windows , . Windows . , " DLL", . SetWinEventHook, API , Windows-, , hook, DLL EXE.
+3

MSDN SetWindowsHookEx. Windows hooks. , SetWindowLongPtr. API - Dll, . :

Dll, HOOKPROC ( hook tpe - )

Dll HOOKPROC. API LoadLibrary/GetProcAddress.

SetWindowsHookEx - DLL . , dll , . , IPC . : , , DLL, , Windows, COM + .. ..

API, , DLL.

!

+3

, firefox ++ aPI, .... , firefox , , hook.

spy ++ V++ firefox, , MozillaContentWindowClass , . , .

SetWindowLongPtr .

0

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


All Articles