Module appModuleHandler
[hide private]

Module appModuleHandler

source code

Manages appModules.

Classes [hide private]
  processEntry32W
  AppModule
Base app module.
  AppProfileTrigger
A configuration profile trigger for when a particular application has focus.
Functions [hide private]
unicode or str
getAppNameFromProcessID(processID, includeExt=False)
Finds out the application name of the given process.
source code
 
getAppModuleForNVDAObject(obj) source code
appModule
getAppModuleFromProcessID(processID)
Finds the appModule that is for the given process ID.
source code
 
update(processID, helperLocalBindingHandle=None, inprocRegistrationHandle=None)
Tries to load a new appModule for the given process ID if need be.
source code
 
cleanup()
Removes any appModules from the cache whose process has died.
source code
 
doesAppModuleExist(name) source code
AppModule
fetchAppModule(processID, appName)
Returns an appModule found in the appModules directory, for the given application name.
source code
 
reloadAppModules()
Reloads running appModules.
source code
 
initialize()
Initializes the appModule subsystem.
source code
 
terminate() source code
 
handleAppSwitch(oldMods, newMods) source code
 
getWmiProcessInfo(processId)
Retrieve the WMI Win32_Process class instance for a given process.
source code
Variables [hide private]
dict runningTable = {}
a dictionary of the currently running appModules, using their application's main window handle as a key.
  NVDAProcessID = None
The process ID of NVDA itself.
  _importers = None
hash(x)
  _getAppModuleLock = threading.RLock()
  post_appSwitch = extensionPoints.Action()
Notifies when another application is taking foreground.
Function Details [hide private]

getAppNameFromProcessID(processID, includeExt=False)

source code 

Finds out the application name of the given process.

Parameters:
  • processID (int) - the ID of the process handle of the application you wish to get the name of.
  • includeExt - True to include the extension of the application's executable filename, False to exclude it.
  • window (bool)
Returns: unicode or str
application name

getAppModuleFromProcessID(processID)

source code 

Finds the appModule that is for the given process ID. The module is also cached for later retreavals.

Parameters:
  • processID (int) - The ID of the process for which you wish to find the appModule.
Returns: appModule
the appModule, or None if there isn't one

update(processID, helperLocalBindingHandle=None, inprocRegistrationHandle=None)

source code 

Tries to load a new appModule for the given process ID if need be.

Parameters:
  • processID (int) - the ID of the process.
  • helperLocalBindingHandle - an optional RPC binding handle pointing to the RPC server for this process
  • inprocRegistrationHandle - an optional rpc context handle representing successful registration with the rpc server for this process

fetchAppModule(processID, appName)

source code 

Returns an appModule found in the appModules directory, for the given application name.

Parameters:
  • processID (integer) - process ID for it to be associated with
  • appName (unicode or str) - the application name for which an appModule should be found.
Returns: AppModule
the appModule, or None if not found

reloadAppModules()

source code 

Reloads running appModules. especially, it clears the cache of running appModules and deletes them from sys.modules. Each appModule will then be reloaded immediately.

getWmiProcessInfo(processId)

source code 

Retrieve the WMI Win32_Process class instance for a given process. For details about the available properties, see http://msdn.microsoft.com/en-us/library/aa394372%28v=vs.85%29.aspx

Parameters:
  • processId (int) - The id of the process in question.
Returns:
The WMI Win32_Process class instance.
Raises:
  • LookupError - If there was an error retrieving the instance.

Variables Details [hide private]

post_appSwitch

Notifies when another application is taking foreground. This allows components to react upon application switches. For example, braille triggers bluetooth polling for braille displaysf necessary. Handlers are called with no arguments.

Value:
extensionPoints.Action()