forked from goldendict/goldendict
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGDDataTranfer.h
46 lines (35 loc) · 1.11 KB
/
GDDataTranfer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __GDDATATRANSFER_H_
#define __GDDATATRANSFER_H_
/*
Header for other program to interact with GoldenDict
When GD needs to retrieve word under mouse cursor it can ask for this a target program
by sending a message.
GD_MESSAGE_NAME - name of the this message
Message number must be retrieved through RegisterWindowMessage function
Message parameters:
WPARAM - 0, not used
LPARAM - pointer to GDDataStruct structure
GDDataStruct fields:
dwSize - Structure size
hWnd - Window with requested word
Pt - Request coordinates (in screen coordinates, device units)
dwMaxLength - Maximum word length to transfer (buffer size in unicode symbols)
cwData - Buffer for requested word in UNICODE
If program process this message it must fill cwData and return TRUE
Otherwise GD will work by old technique
*/
#ifdef UNICODE
#define GD_MESSAGE_NAME L"GOLDENDICT_GET_WORD_IN_COORDINATES"
#else
#define GD_MESSAGE_NAME "GOLDENDICT_GET_WORD_IN_COORDINATES"
#endif
#pragma pack(push,1)
typedef struct {
DWORD dwSize;
HWND hWnd;
POINT Pt;
DWORD dwMaxLength;
WCHAR *cwData;
} GDDataStruct, *LPGDDataStruct;
#pragma pack(pop)
#endif