goldendict-ng/mouseover_win32/ThTypes.c
Abs62 a8589b39bf Improvements in scan popup functionality.
1. Add search word under cursor through IAccessibleEx interface and UI Automation technology.
2. Reorganize GoldenDict main program and scan libraries interaction to reduce influence to other programs.
3. Fix crash in scan libraries in IE9 protected mode.
2011-07-09 23:26:30 +04:00

29 lines
688 B
C

#include "ThTypes.h"
HANDLE MMFHandle = 0;
TGlobalDLLData *GlobalData = NULL;
void ThTypes_Init()
{
if (!MMFHandle) {
MMFHandle = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(TGlobalDLLData), "GoldenDictTextOutHookSharedMem");
}
if (!MMFHandle) {
MMFHandle = OpenFileMappingA(FILE_MAP_READ | FILE_MAP_WRITE, 0, "GoldenDictTextOutHookSharedMem");
}
if (!GlobalData && MMFHandle != NULL)
GlobalData = MapViewOfFile(MMFHandle, FILE_MAP_ALL_ACCESS, 0, 0, 0);
}
void Thtypes_End()
{
if (GlobalData) {
UnmapViewOfFile(GlobalData);
GlobalData = NULL;
}
if (MMFHandle) {
CloseHandle(MMFHandle);
MMFHandle = 0;
}
}