#ifndef __CeInk_h__
#define __CeInk_h__
#include "CeWnd.h"
#if (_WIN32_WCE >= 211)
# include <inkx.h>
# include <richink.h>
#else
# include <richink.h>
#endif
class CeInkCtrl: public CeWnd
{
public:
static void Init()
{ InitInkX(); }
BOOL Create(DWORD dwStyle, DWORD dwExStyle, const RECT& rect, HWND hParentWnd, UINT nID, HINSTANCE hInst)
{ return CeWnd::Create(hInst, WC_INKX, hParentWnd, rect, NULL, dwStyle, dwExStyle, nID); }
void ShowCommandBar(BOOL bShow)
{ SendMessage(IM_SHOWCMDBAR, bShow); }
int GetDataLength()
{ return (int) SendMessage(IM_GETDATALEN); }
void ClearAll()
{ SendMessage(IM_CLEARALL); }
void SetData ( int cbInkData, BYTE *lpInkData )
{ SendMessage(IM_SETDATA, (WPARAM) cbInkData, (LPARAM) lpInkData); }
int GetData ( int cbInkData, BYTE *lpInkData )
{ return (int) SendMessage(IM_GETDATA, (WPARAM) cbInkData, (LPARAM) lpInkData); }
};
class CeRichInkCtrl: public CeWnd
{
public:
static void Init()
{ InitRichInkDLL(); }
BOOL Create(DWORD dwStyle, DWORD dwExStyle, const RECT& rect, HWND hParentWnd, UINT nID, HINSTANCE hInst)
{ return CeWnd::Create(hInst, WC_RICHINK, hParentWnd, rect, NULL, dwStyle, dwExStyle, nID); }
//
// SF_TEXT Ascii Text
// SF_RTF Rich Text Format (RTF)
// SF_UTEXT Unicode text
// SF_PWI Pocket Word Ink (PWI)
//
BOOL StreamIn(UINT uFormat, EDITSTREAM* lpStream)
{ return SendMessage(EM_STREAMIN, uFormat, (LPARAM) lpStream); }
BOOL StreamOut(UINT uFormat, EDITSTREAM* lpStream)
{ return SendMessage(EM_STREAMOUT, uFormat, (LPARAM) lpStream); }
void ClearAll()
{ SendMessage(EM_CLEARALL); }
// New functions found by experimentation
void SetPlainBkgnd()
{ SendMessage(WM_USER+250); }
void SetLineBkgnd()
{ SendMessage(WM_USER+251); }
void SetGraphBkgnd()
{ SendMessage(WM_USER+252); }
// Set the zoom for the rich edit control, I know 75/100/150/200/300 all work
void SetZoom(int nZoom)
{ SendMessage(WM_USER+290, 0, nZoom); }
void SelectAll()
{ SendMessage(WM_USER+206); }
void GetFormatting(BYTE* pBuf)
{ SendMessage(WM_USER+212, 0, (LPARAM) pBuf); }
void SetFormatting(BYTE* pBuf)
{ SendMessage(WM_USER+213, 0, (LPARAM) pBuf); }
};
//---------------------------------------------------------
//
// Other useful Rich Edit control and Windows messages
// that are supported by the Rich Ink control:
//
// EM_GETSEL
// EM_SETSEL
// EM_REPLACESEL
// EM_GETMODIFY
// EM_SETMODIFY
//
// WM_GETTEXTLENGTH
// WM_GETTEXT
// WM_SETTEXT
//
// WM_CUT
// WM_COPY
// WM_PASTE
// WM_CLEAR
// EM_CANPASTE
//
// See Microsoft Developer Studio Help or MSDN for more details.
//---------------------------------------------------------
#pragma comment(lib, "inkx.lib")
#endif // __CeInk_h__