2025-04-27 07:49:33 -04:00

58 lines
1.1 KiB
C++

//
// snoop.h
//
// CSnoopWnd declaration.
//
#ifndef SNOOP_H
#define SNOOP_H
#define MAX_SNOOP_TEXT 32
class CCaseTextService;
class CUpdateTextEditSession;
class CSnoopWnd
{
public:
CSnoopWnd(CCaseTextService *pCase);
static BOOL _InitClass();
static void _UninitClass();
BOOL _Init();
void _Uninit();
void _Show();
void _Hide();
void _UpdateText(ITfRange *pRange);
void _UpdateText(TfEditCookie ec, ITfContext *pContext, ITfRange *pRange);
private:
friend CUpdateTextEditSession;
static LRESULT CALLBACK _WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
void _OnPaint(HWND hWnd, HDC hdc);
static void _SetThis(HWND hWnd, LPARAM lParam)
{
SetWindowLong(hWnd, GWL_USERDATA,
(LONG)((CREATESTRUCT *)lParam)->lpCreateParams);
}
static CSnoopWnd *_GetThis(HWND hWnd)
{
return (CSnoopWnd *)GetWindowLong(hWnd, GWL_USERDATA);
}
CCaseTextService *_pCase;
HWND _hWnd;
ULONG _cchText;
WCHAR _achText[MAX_SNOOP_TEXT];
static ATOM _atomWndClass;
};
#endif // SNOOP_H