⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _w32sys.h

📁 Windows CE 6.0 Word Application 源码
💻 H
📖 第 1 页 / 共 3 页
字号:
    }

    static inline void *FillMemory(void *dst, int fill, size_t cb)
    {
        return memset(dst, fill, cb);
    }

    static inline void *ZeroMemory(void *dst, size_t cb)
    {
        return memset(dst, 0, cb);
    }

    static inline int CompareMemory(const void *s1, const void *s2, size_t cb)
    {
        return memcmp(s1, s2, cb);
    }

    // ----------------------------------
    // IME Support
    // ----------------------------------
    static BOOL ImmInitialize( void );
    static void ImmTerminate( void );

    static LONG ImmGetCompositionStringA ( HIMC, DWORD, LPVOID, DWORD );
    static BOOL ImmSetCompositionFontA ( HIMC, LPLOGFONTA );

// GuyBark: Use the real system functions:
#ifndef PWD_JUPITER

    static HIMC ImmGetContext ( HWND );
    static BOOL ImmSetCompositionWindow ( HIMC, LPCOMPOSITIONFORM );
    static BOOL ImmReleaseContext ( HWND, HIMC );
    static DWORD ImmGetProperty ( HKL, DWORD );
    static BOOL ImmGetCandidateWindow ( HIMC, DWORD, LPCANDIDATEFORM );
    static BOOL ImmSetCandidateWindow ( HIMC, LPCANDIDATEFORM );
    static BOOL ImmNotifyIME ( HIMC, DWORD, DWORD, DWORD );
    static HIMC ImmAssociateContext ( HWND, HIMC );
    static UINT ImmGetVirtualKey ( HWND );
    static HIMC ImmEscape ( HKL, HIMC, UINT, LPVOID );
    static LONG ImmGetOpenStatus ( HIMC );
    static BOOL ImmGetConversionStatus ( HIMC, LPDWORD, LPDWORD );

#endif // !PWD_JUPITER

    static BOOL FSupportSty ( UINT, UINT );
    static const IMESTYLE * PIMEStyleFromAttr ( const UINT );
    static const IMECOLORSTY * PColorStyleTextFromIMEStyle ( const IMESTYLE * );
    static const IMECOLORSTY * PColorStyleBackFromIMEStyle ( const IMESTYLE * );
    static BOOL FBoldIMEStyle ( const IMESTYLE * );
    static BOOL FItalicIMEStyle ( const IMESTYLE * );
    static BOOL FUlIMEStyle ( const IMESTYLE * );
    static UINT IdUlIMEStyle ( const IMESTYLE * );
    static COLORREF RGBFromIMEColorStyle ( const IMECOLORSTY * );

    // ----------------------------------
    // National Language Keyboard support
    // ----------------------------------
    static void CheckChangeKeyboardLayout ( CTxtSelection *psel, BOOL fChangedFont );
    static void CheckChangeFont (
        CTxtSelection *psel,
        CTxtEdit * const ped,
        BOOL fEnableReassign,   // @parm Do we enable CTRL key?
        const WORD lcID,        // @parm LCID from WM_ message
        UINT cpg                // @parm code page to use (could be ANSI for far east with IME off)
    );
    static BOOL FormatMatchesKeyboard( const CCharFormat *pFormat );
//    static HKL GetKeyboardLayout ( DWORD );
//    static int GetKeyboardLayoutList ( int, HKL FAR * );

    // ----------------------------------
    // OLE Support
    // ----------------------------------
    static HRESULT LoadRegTypeLib ( REFGUID, WORD, WORD, LCID, ITypeLib ** );
    static HRESULT LoadTypeLib ( const OLECHAR *, ITypeLib ** );
    static BSTR SysAllocString ( const OLECHAR * );
    static BSTR SysAllocStringLen ( const OLECHAR *, UINT );
    static void SysFreeString ( BSTR );
    static UINT SysStringLen ( BSTR );
    static void VariantInit ( VARIANTARG * );
    static HRESULT OleCreateFromData ( LPDATAOBJECT, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, void ** );
    static void CoTaskMemFree ( LPVOID );
    static HRESULT CreateBindCtx ( DWORD, LPBC * );
    static HANDLE OleDuplicateData ( HANDLE, CLIPFORMAT, UINT );
    static HRESULT CoTreatAsClass ( REFCLSID, REFCLSID );
    static HRESULT ProgIDFromCLSID ( REFCLSID, LPOLESTR * );
    static HRESULT OleConvertIStorageToOLESTREAM ( LPSTORAGE, LPOLESTREAM );
    static HRESULT OleConvertIStorageToOLESTREAMEx ( LPSTORAGE, CLIPFORMAT, LONG, LONG, DWORD, LPSTGMEDIUM, LPOLESTREAM );
    static HRESULT OleSave ( LPPERSISTSTORAGE, LPSTORAGE, BOOL );
    static HRESULT StgCreateDocfileOnILockBytes ( ILockBytes *, DWORD, DWORD, IStorage ** );
    static HRESULT CreateILockBytesOnHGlobal ( HGLOBAL, BOOL, ILockBytes ** );
    static HRESULT OleCreateLinkToFile ( LPCOLESTR, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, void ** );
    static LPVOID CoTaskMemAlloc ( ULONG );
    static LPVOID CoTaskMemRealloc ( LPVOID, ULONG );
    static HRESULT OleInitialize ( LPVOID );
    static void OleUninitialize ( );
    static HRESULT OleSetClipboard ( IDataObject * );
    static HRESULT OleFlushClipboard ( );
    static HRESULT OleIsCurrentClipboard ( IDataObject * );
    static HRESULT DoDragDrop ( IDataObject *, IDropSource *, DWORD, DWORD * );
    static HRESULT OleGetClipboard ( IDataObject ** );
    static HRESULT RegisterDragDrop ( HWND, IDropTarget * );
    static HRESULT OleCreateLinkFromData ( IDataObject *, REFIID, DWORD, LPFORMATETC, IOleClientSite *, IStorage *, void ** );
    static HRESULT OleCreateStaticFromData ( IDataObject *, REFIID, DWORD, LPFORMATETC, IOleClientSite *, IStorage *, void ** );
    static HRESULT OleDraw ( IUnknown *, DWORD, HDC, LPCRECT );
    static HRESULT OleSetContainedObject ( IUnknown *, BOOL );
    static HRESULT CoDisconnectObject ( IUnknown *, DWORD );
    static HRESULT WriteFmtUserTypeStg ( IStorage *, CLIPFORMAT, LPOLESTR );
    static HRESULT WriteClassStg ( IStorage *, REFCLSID );
    static HRESULT SetConvertStg ( IStorage *, BOOL );
    static HRESULT ReadFmtUserTypeStg ( IStorage *, CLIPFORMAT *, LPOLESTR * );
    static HRESULT ReadClassStg ( IStorage *pstg, CLSID * );
    static HRESULT OleRun ( IUnknown * );
    static HRESULT RevokeDragDrop ( HWND );
    static HRESULT CreateStreamOnHGlobal ( HGLOBAL, BOOL, IStream ** );
    static HRESULT GetHGlobalFromStream ( IStream *pstm, HGLOBAL * );
    static HRESULT OleCreateDefaultHandler ( REFCLSID, IUnknown *, REFIID, void ** );
    static HRESULT CLSIDFromProgID ( LPCOLESTR, LPCLSID );
    static HRESULT OleConvertOLESTREAMToIStorage ( LPOLESTREAM, IStorage *, const DVTARGETDEVICE * );
    static HRESULT OleLoad ( IStorage *, REFIID, IOleClientSite *, void ** );
    static HRESULT ReleaseStgMedium ( LPSTGMEDIUM );
    static void FreeOle();

    // ----------------------------------
    // Debugging Support
    //   Weak dbug32.dll replacement
    // ----------------------------------
    #ifdef DEBUG
    void AssertFn(BOOL, LPSTR, LPSTR, int);
    void sprintf (CHAR * buff, char *fmt, ...);
    void TraceOn ( void );
    void TraceOff (void );
    void TraceMsg(WCHAR *ptext);
    #endif

    // ----------------------------------
    // Useful ANSI<-->Unicode conversion
    //          and language id routines
    // ----------------------------------
    static LONG CharSetIndexFromChar(TCHAR ch);
    static BOOL CheckDBCInUnicodeStr(TCHAR *ptext);
    static int  MbcsFromUnicode(LPSTR pstr, int cch, LPCWSTR pwstr,
                    int cwch = -1, UINT codepage = CP_ACP,
                    UN_FLAGS flags = UN_CONVERT_WCH_EMBEDDING);
    static int  UnicodeFromMbcs(LPWSTR pwstr, int cwch, LPCSTR pstr, int cch = -1,
                    UINT uiCodePage = CP_ACP);
    static int  MBTWC(INT CodePage, DWORD dwFlags, LPCSTR pstrMB, int cchMB,
                    LPWSTR pstrWC, int cchWC, LPBOOL pfNoCodePage);
    static int  WCTMB(INT CodePage, DWORD dwFlags, LPCWSTR pstrWC, int cchWC,
                    LPSTR pstrMB, int cchMB, LPCSTR pchDefault, LPBOOL pfUsedDef,
                    LPBOOL pfNoCodePage);
    static HGLOBAL TextHGlobalAtoW( HGLOBAL hglobal, BOOL *pbDBC );
    static HGLOBAL TextHGlobalWtoA( HGLOBAL hglobal );
    static UINT ConvertLanguageIDtoCodePage(WORD lid);
    static BOOL IsFELCID(LCID lcid);
    static BOOL IsFECharset(BYTE bCharSet);
    static BOOL IsFEChar(WCHAR ch); // GuyBark: Added this.
    static INT  In125x(WCHAR ch, BYTE bCharSet);
    static BOOL IsLeadByte(BYTE ach, UINT cpg);
    static BOOL IsTrailByte(BYTE *aszBuff, LONG cb, UINT cpg);
    static BYTE GetCharSet(INT);
    static INT  GetCodePage(BYTE bCharSet);
    static UINT GetKeyboardCodePage();
    static LCID GetKeyboardLCID();
    static UINT GetLocaleCodePage();
    static LCID GetLocaleLCID();
    static BOOL IsCharSetValid(BYTE bCharSet);
    static BOOL ConvertCHARFORMATAtoW( CHARFORMATA *pcfmtA, CHARFORMATW *pcfmtW );
    static BOOL ConvertCHARFORMATWtoA( CHARFORMATW *pcfmtW, CHARFORMATA *pcfmtA );

    // ----------------------------------
    // Unicode Wrapped Functions
    // ----------------------------------

    // We could use inline and a function pointer table to improve efficiency and code size.

    static ATOM WINAPI RegisterREClass(
        const WNDCLASSW *lpWndClass,
        const char *szAnsiClassName,
        WNDPROC AnsiWndProc
    );
    static BOOL GetVersion(
        DWORD *pdwPlatformId,
        DWORD *pdwMajorVersion
    );
    static BOOL WINAPI GetStringTypeEx(
        LCID     Locale,
        DWORD    dwInfoType,
        LPCWSTR lpSrcStr,
        int      cchSrc,
        LPWORD   lpCharType
    );
    static LPWSTR WINAPI CharLower(LPWSTR pwstr);
    static DWORD WINAPI CharLowerBuff(LPWSTR pwstr, DWORD cchLength);
    static DWORD WINAPI CharUpperBuff(LPWSTR pwstr, DWORD cchLength);
    static HDC WINAPI CreateIC(
        LPCWSTR             lpszDriver,
        LPCWSTR             lpszDevice,
        LPCWSTR             lpszOutput,
        CONST DEVMODEW *    lpInitData
    );
    static HANDLE WINAPI CreateFile(
        LPCWSTR                 lpFileName,
        DWORD                   dwDesiredAccess,
        DWORD                   dwShareMode,
        LPSECURITY_ATTRIBUTES   lpSecurityAttributes,
        DWORD                   dwCreationDisposition,
        DWORD                   dwFlagsAndAttributes,
        HANDLE                  hTemplateFile
    );
    static HFONT WINAPI CreateFontIndirect(CONST LOGFONTW * plfw);
    static int WINAPI CompareString (
        LCID  Locale,           // locale identifier
        DWORD  dwCmpFlags,      // comparison-style options
        LPCWSTR  lpString1,     // pointer to first string
        int  cchCount1,         // size, in bytes or characters, of first string
        LPCWSTR  lpString2,     // pointer to second string
        int  cchCount2          // size, in bytes or characters, of second string
    );
    static LRESULT WINAPI DefWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
    static int WINAPI GetObject(HGDIOBJ hgdiObj, int cbBuffer, LPVOID lpvObj);
    static DWORD APIENTRY GetProfileSection(
        LPCWSTR lpAppName,
        LPWSTR lpReturnedString,
        DWORD nSize
    );
    static BOOL APIENTRY GetTextExtentPoint32(
        HDC     hdc,
        LPCWSTR pwsz,
        int     cb,
        LPSIZE  pSize
    );
    static int WINAPI GetTextFace(
        HDC    hdc,
        int    cch,
        LPWSTR lpFaceName
    );
    static BOOL WINAPI GetTextMetrics(HDC hdc, LPTEXTMETRICW lptm);
    static LONG WINAPI GetWindowLong(HWND hWnd, int nIndex);
    static HBITMAP WINAPI LoadBitmap(HINSTANCE hInstance, LPCWSTR lpBitmapName);
    static HCURSOR WINAPI LoadCursor(HINSTANCE hInstance, LPCWSTR lpCursorName);
    static HINSTANCE WINAPI LoadLibrary(LPCWSTR lpLibFileName);
    static LRESULT WINAPI SendMessage(
        HWND    hWnd,
        UINT    Msg,
        WPARAM  wParam,
        LPARAM  lParam
    );
    static LONG WINAPI SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong);
    static BOOL WINAPI PostMessage(
        HWND    hWnd,
        UINT    Msg,
        WPARAM  wParam,
        LPARAM  lParam
    );
    static BOOL WINAPI UnregisterClass(LPCWSTR lpClassName, HINSTANCE hInstance);
    static int WINAPI lstrcmp(LPCWSTR lpString1, LPCWSTR lpString2);
    static int WINAPI lstrcmpi(LPCWSTR lpString1, LPCWSTR lpString2);
    static BOOL WINAPI PeekMessage(
        LPMSG   lpMsg,
        HWND    hWnd,
        UINT    wMsgFilterMin,
        UINT    wMsgFilterMax,
        UINT    wRemoveMsg
    );
    static DWORD WINAPI GetModuleFileName(
        HMODULE hModule,
        LPWSTR lpFilename,
        DWORD nSize
    );

    // Should also be wrapped but aren't.  Used for debugging.
    // MessageBox
    // OutputDebugString

    // lstrcmpiA should also be wrapped for Win CE's sake but the code
    // that uses it is ifdeffed out for WINCE.
};

extern CW32System *W32;

#if !defined(W32SYS_CPP)

#define PvAlloc             W32->PvAlloc
#define PvReAlloc           W32->PvReAlloc
#define FreePv              W32->FreePv
#define CopyMemory          W32->CopyMemory
#define MoveMemory          W32->MoveMemory
#define FillMemory          W32->FillMemory
#define ZeroMemory          W32->ZeroMemory
#define CompareMemory       W32->CompareMemory
#define GlobalAlloc         W32->GlobalAlloc
#define GlobalFree          W32->GlobalFree
#define GlobalFlags         W32->GlobalFlags
#define GlobalReAlloc       W32->GlobalReAlloc
#define GlobalSize          W32->GlobalSize
#define GlobalLock          W32->GlobalLock
#define GlobalHandle        W32->GlobalHandle
#define GlobalUnlock        W32->GlobalUnlock
#define GetTextAlign        W32->GetTextAlign
#define SetTextAlign        W32->SetTextAlign
#define InvertRect          W32->InvertRect

#define ImmInitialize W32->ImmInitialize
#define ImmTerminate W32->ImmTerminate

// GuyBark: Use the real system functions:
#ifndef PWD_JUPITER

#define pImmGetCompositionString W32->ImmGetCompositionStringA
#define pImmGetContext W32->ImmGetContext
#define pImmSetCompositionFont W32->ImmSetCompositionFontA
#define pImmSetCompositionWindow W32->ImmSetCompositionWindow
#define pImmReleaseContext W32->ImmReleaseContext
#define pImmGetProperty W32->ImmGetProperty
#define pImmGetCandidateWindow W32->ImmGetCandidateWindow
#define pImmSetCandidateWindow W32->ImmSetCandidateWindow
#define pImmNotifyIME W32->ImmNotifyIME
#define pImmAssociateContext W32->ImmAssociateContext
#define pImmGetVirtualKey W32->ImmGetVirtualKey
#define pImmEscape W32->ImmEscape

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -