NVDA Helper
In-process and lite high-speed utilities for NVDA
inProcess.cpp File Reference
#include <cstdio>
#include <list>
#include <set>
#include <map>
#include <windows.h>
#include "winword.h"
#include "inputLangChange.h"
#include "typedCharacter.h"
#include "tsf.h"
#include "ime.h"
#include "IA2Support.h"
#include "ia2LiveRegions.h"
#include <common/log.h>
#include "gdiHooks.h"
#include "nvdaHelperRemote.h"
#include "inProcess.h"

Go to the source code of this file.

Macros

#define WIN32_LEAN_AND_MEAN
 

Typedefs

typedef map< WINEVENTPROC, size_t > winEventHookRegistry_t
 
typedef map< HOOKPROC, size_t > windowsHookRegistry_t
 

Functions

void inProcess_initialize ()
 
void inProcess_terminate ()
 
bool registerWinEventHook (WINEVENTPROC hookProc)
 Registers a callback function to be called with in future win events for this process.
 
bool unregisterWinEventHook (WINEVENTPROC hookProc)
 Unregisters a previously registered callback function for a win event for this process.
 
bool registerWindowsHook (int hookType, HOOKPROC hookProc)
 Registers a callback function to be called with in future windows hooks fired for this process.
 
bool unregisterWindowsHook (int hookType, HOOKPROC hookProc)
 Unregisters a previously registered callback function for a windows hook for this process.
 
LRESULT CALLBACK inProcess_getMessageHook (int code, WPARAM wParam, LPARAM lParam)
 
LRESULT CALLBACK inProcess_callWndProcHook (int code, WPARAM wParam, LPARAM lParam)
 
void CALLBACK inProcess_winEventCallback (HWINEVENTHOOK hookID, DWORD eventID, HWND hwnd, long objectID, long childID, DWORD threadID, DWORD time)
 
bool execInThread (long threadID, execInThread_funcType func)
 

Variables

winEventHookRegistry_t inProcess_registeredWinEventHooks
 
windowsHookRegistry_t inProcess_registeredCallWndProcWindowsHooks
 
windowsHookRegistry_t inProcess_registeredGetMessageWindowsHooks
 
UINT wm_execInThread
 

Macro Definition Documentation

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Typedef Documentation

◆ winEventHookRegistry_t

typedef map<WINEVENTPROC,size_t> winEventHookRegistry_t

◆ windowsHookRegistry_t

typedef map<HOOKPROC,size_t> windowsHookRegistry_t

Function Documentation

◆ inProcess_initialize()

◆ inProcess_terminate()

◆ registerWinEventHook()

bool registerWinEventHook ( WINEVENTPROC hookProc)

Registers a callback function to be called with in future win events for this process.

Parameters
procHookthe callback function which should be called
Returns
true if the hook was registered, false otherwise.

References inProcess_registeredWinEventHooks.

Referenced by ia2LiveRegions_inProcess_initialize(), IA2Support_inProcess_initialize(), AdobeAcrobatVBufBackend_t::renderThread_initialize(), GeckoVBufBackend_t::renderThread_initialize(), lotusNotesRichTextVBufBackend_t::renderThread_initialize(), VBufBackend_t::renderThread_initialize(), WebKitVBufBackend_t::renderThread_initialize(), and TSF_inProcess_initialize().

◆ unregisterWinEventHook()

bool unregisterWinEventHook ( WINEVENTPROC hookProc)

Unregisters a previously registered callback function for a win event for this process.

It may be possible for the winEvent hook to fire one more time after unregistration if the unregistration happens within a winEvent hook.

Parameters
hookProcthe callback function to be unregistered
Returns
True if it was unregistered, false otherwize.

References inProcess_registeredWinEventHooks, and nhAssert.

Referenced by ia2LiveRegions_inProcess_terminate(), IA2Support_inProcess_terminate(), AdobeAcrobatVBufBackend_t::renderThread_terminate(), GeckoVBufBackend_t::renderThread_terminate(), lotusNotesRichTextVBufBackend_t::renderThread_terminate(), VBufBackend_t::renderThread_terminate(), WebKitVBufBackend_t::renderThread_terminate(), and TSF_inProcess_terminate().

◆ registerWindowsHook()

bool registerWindowsHook ( int hookType,
HOOKPROC hookProc )

Registers a callback function to be called with in future windows hooks fired for this process.

Parameters
hookTypethe type of windows hook (WH_CALLWNDPROC, WH_GETMESSAGE)
procHookthe callback function which should be called
Returns
true if the hook was registered, false otherwise.

References inProcess_registeredCallWndProcWindowsHooks, and inProcess_registeredGetMessageWindowsHooks.

Referenced by IA2Support_inProcess_terminate(), IME_inProcess_initialize(), VBufBackend_t::initialize(), inputLangChange_inProcess_initialize(), typedCharacter_inProcess_initialize(), and winword_inProcess_initialize().

◆ unregisterWindowsHook()

bool unregisterWindowsHook ( int hookType,
HOOKPROC hookProc )

Unregisters a previously registered callback function for a windows hook for this process.

It may be possible for the windows hook to fire one more time after unregistration if the unregistration happens within a windows hook.

Parameters
hookTypethe type of windows hook
hookProcthe callback function to be unregistered
Returns
True if it was unregistered, false otherwize.

References inProcess_registeredCallWndProcWindowsHooks, inProcess_registeredGetMessageWindowsHooks, and nhAssert.

Referenced by IA2Support_inProcess_terminate(), IME_inProcess_terminate(), inputLangChange_inProcess_terminate(), VBufBackend_t::terminate(), typedCharacter_inProcess_terminate(), and winword_inProcess_terminate().

◆ inProcess_getMessageHook()

LRESULT CALLBACK inProcess_getMessageHook ( int code,
WPARAM wParam,
LPARAM lParam )

◆ inProcess_callWndProcHook()

LRESULT CALLBACK inProcess_callWndProcHook ( int code,
WPARAM wParam,
LPARAM lParam )

◆ inProcess_winEventCallback()

void CALLBACK inProcess_winEventCallback ( HWINEVENTHOOK hookID,
DWORD eventID,
HWND hwnd,
long objectID,
long childID,
DWORD threadID,
DWORD time )

◆ execInThread()

Variable Documentation

◆ inProcess_registeredWinEventHooks

◆ inProcess_registeredCallWndProcWindowsHooks

windowsHookRegistry_t inProcess_registeredCallWndProcWindowsHooks

◆ inProcess_registeredGetMessageWindowsHooks

windowsHookRegistry_t inProcess_registeredGetMessageWindowsHooks

◆ wm_execInThread

UINT wm_execInThread