?? defination.h
字號(hào):
#include <afxcmn.h>
#include "resource.h"
#include "MySip.h"
//////////////////////////////////////////////////////////////
// *** Custom Message Definition *** //
//////////////////////////////////////////////////////////////
#define MYSIPCLS _T("Simple Keyboard")
#define WM_METHCALL WM_USER + 50 // Used to pass info
#define MSGCODE_REGCALLBACK 0 // Notification codes for
#define MSGCODE_GETINFO 1 // WM_METHCALL
#define MSGCODE_SETINFO 2
#define MSGCODE_REGCALLBACK2 3
//////////////////////////////////////////////////////////////
// *** Interval, Margin, Width and Height *** //
//////////////////////////////////////////////////////////////
#define WDTH 32
#define HGHT 32
#define MRGN 2
#define INTV 2
#define WDTH_BAK 66
#define WDTH_ESC WDTH
#define WDTH_CAP WDTH_ESC*2+MRGN
#define WDTH_RTN_1 32
#define WDTH_RTN_2 64
#define WDTH_SPC 82
//////////////////////////////////////////////////////////////
// *** Width and Height of SIP *** //
//////////////////////////////////////////////////////////////
#define FLOATWIDTH (WDTH*10+MRGN*13+WDTH_ESC+WDTH_BAK+5)
#define FLOATHEIGHT (HGHT*4+MRGN*5+28)
//////////////////////////////////////////////////////////////
// *** Number of Columns and Rows *** //
//////////////////////////////////////////////////////////////
#define COL_OF_BTNS 12
#define ROW_OF_BTNS 4
//////////////////////////////////////////////////////////////
// *** Color of Pen and Brush *** //
//////////////////////////////////////////////////////////////
#define PRESSEDBKG RGB(0,0,230)
#define UNPRESSEDBKG RGB(255,255,255)
#define PRESSEDFONT RGB(255,255,255)
#define UNPRESSEDFONT RGB(0,0,0)
#define EDGE1 RGB(192,192,192)
#define EDGE2 RGB(128,128,128)
//////////////////////////////////////////////////////////////
// *** System variables Declaration *** //
//////////////////////////////////////////////////////////////
extern HINSTANCE hInst;
//////////////////////////////////////////////////////////////
// *** Struct Definitions *** //
//////////////////////////////////////////////////////////////
struct KEYBUTTON
{
int left;
int top;
int right;
int bottom;
UINT keyVChar; // the Virtual key to be sent when not in Cap
UINT keyVCharCap; // the Virtual key to be sent when in Cap
TCHAR keyTChar; // the Text on the key button when not in Cap
TCHAR keyTCharCap; // the Text on the key button when in Cap
};
typedef struct
{
int iRowPrev;
int iColPrev;
BOOL bCapital;
BOOL bPressed;
IIMCallback *pIMCallback;
IIMCallback2 *pIMCallback2;
RECT rectDocked;
BOOL fMoving;
POINT ptMovBasis;
POINT ptMovStart;
IMINFO imi;
RECT rectLast;
}
SIPWNDSTRUCT, *LPSIPWNDSTRUCT;
struct decodeUINT
{ // Structure associates
UINT Code; // messages with a function.
LRESULT (*Fxn)(HWND, UINT, WPARAM, LPARAM);
};
//////////////////////////////////////////////////////
// *** Function Declarations *** //
//////////////////////////////////////////////////////
#define dim(x) (sizeof(x) / sizeof(x[0]))
INT DrawButton (HDC hdc, HPEN hPrsPen, HBRUSH hPrsBrush,
HPEN hUPrsPen, HBRUSH hUPrsBrush, /*RECT *prect,
LPTSTR pChar*/KEYBUTTON& btn, BOOL fPressed, BOOL fCapital);
HWND CreateIMWindow (HWND hwndParent);
int DestroyIMWindow (HWND hwnd);
LRESULT CALLBACK NPWndProc (HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK OnCreate (HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK OnSetSip (HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK OnPaint (HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK OnTouch (HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK OnDestroy (HWND, UINT, WPARAM, LPARAM);
//////////////////////////////////////////////////////
// *** Message Map Definition *** //
//////////////////////////////////////////////////////
const struct decodeUINT SipMessages[] =
{
WM_CREATE, OnCreate,
WM_PAINT, OnPaint,
WM_METHCALL, OnSetSip,
WM_LBUTTONDOWN, OnTouch,
WM_MOUSEMOVE, OnTouch,
WM_LBUTTONUP, OnTouch,
WM_LBUTTONDBLCLK, OnTouch,
WM_DESTROY, OnDestroy,
};
//////////////////////////////////////////////////////
// *** GUID Definition *** //
//////////////////////////////////////////////////////
extern "C" const GUID __declspec(selectany) IID_IIMCallback =
{0x42429669,0xae04,0x11d0,{0xa4,0xf8,0x00,0xaa,0x00,0xa7,0x49,0xb9}};
extern "C" const GUID __declspec(selectany) IID_IInputMethod =
{0x42429666,0xae04,0x11d0,{0xa4,0xf8,0x00,0xaa,0x00,0xa7,0x49,0xb9}};
extern "C" const GUID __declspec(selectany) CLSID_CMSDvorakIm =
{0x42429695,0xae04,0x11d0,{0xa4,0xf8,0x00,0xaa,0x00,0xa7,0x49,0xb9}};
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -