📄 wcehelper.h
字号:
#ifndef __WCEHELPER_H__
#define __WCEHELPER_H__
// ------------------------------------------------ //
#if (_WIN32_WCE >= 300) && defined(WIN32_PLATFORM_PSPC)
#include <aygshell.h>
#else
#define SHIDIM_FLAGS 0x0001
#define SHIDIF_DONEBUTTON 0x0001
#define SHIDIF_SIZEDLG 0x0002
#define SHIDIF_SIZEDLGFULLSCREEN 0x0004
#define SHIDIF_SIPDOWN 0x0008
#define SHIDIF_FULLSCREENNOMENUBAR 0x0010
typedef struct tagSHINITDIALOG{
DWORD dwMask;
HWND hDlg;
DWORD dwFlags;
} SHINITDLGINFO, *PSHINITDLGINFO;
#define SHCMBF_EMPTYBAR 0x0001
#define SHCMBF_HIDDEN 0x0002
#define SHCMBF_HIDESIPBUTTON 0x0004
typedef struct tagSHMENUBARINFO{
DWORD cbSize;
HWND hwndParent;
DWORD dwFlags;
UINT nToolBarId;
HINSTANCE hInstRes;
int nBmpId;
int cBmpImages;
HWND hwndMB;
} SHMENUBARINFO, *PSHMENUBARINFO;
#define SIPF_OFF 0x00000000
#define SIPF_ON 0x00000001
#define SIPF_DOCKED 0x00000002
#define SIPF_LOCKED 0x00000004
typedef struct {
DWORD cbSize;
DWORD fdwFlags;
RECT rcVisibleDesktop;
RECT rcSipRect;
DWORD dwImDataSize;
VOID *pvImData;
} SIPINFO;
#endif
// #if (_WIN32_WCE < 300) || (WIN32_PLATFORM_PSPC<310) // modified by Y.N for VS2005
#if (_WIN32_WCE < 300)
#define SHCNE_RENAME 0x00000001L // GOING AWAY
#define SHCNE_RENAMEITEM 0x00000001L
#define SHCNE_CREATE 0x00000002L
#define SHCNE_DELETE 0x00000004L
#define SHCNE_MKDIR 0x00000008L
#define SHCNE_RMDIR 0x00000010L
#define SHCNE_MEDIAINSERTED 0x00000020L
#define SHCNE_MEDIAREMOVED 0x00000040L
#define SHCNE_DRIVEREMOVED 0x00000080L
#define SHCNE_DRIVEADD 0x00000100L
#define SHCNE_NETSHARE 0x00000200L
#define SHCNE_NETUNSHARE 0x00000400L
#define SHCNE_ATTRIBUTES 0x00000800L
#define SHCNE_UPDATEDIR 0x00001000L
#define SHCNE_UPDATEITEM 0x00002000L
#define SHCNE_SERVERDISCONNECT 0x00004000L
#define SHCNE_UPDATEIMAGE 0x00008000L
#define SHCNE_DRIVEADDGUI 0x00010000L
#define SHCNE_RENAMEFOLDER 0x00020000L
#define SHCNE_ASSOCCHANGED 0x08000000L
#define SHCNE_DISKEVENTS 0x0002381FL
#define SHCNE_GLOBALEVENTS 0x0C0181E0L // Events that dont match pidls first
#define SHCNE_ALLEVENTS 0x7FFFFFFFL
#define SHCNE_INTERRUPT 0x80000000L // The presence of this flag indicates
// that the event was generated by an
// interrupt. It is stripped out before
// the clients of SHCNNotify_ see it.
// Flags
// uFlags & SHCNF_TYPE is an ID which indicates what dwItem1 and dwItem2 mean
#define SHCNF_IDLIST 0x0000 // LPITEMIDLIST
#define SHCNF_PATH 0x0001 // path name
#define SHCNF_PRINTER 0x0002 // printer friendly name
#define SHCNF_DWORD 0x0003 // DWORD
#define SHCNF_TYPE 0x00FF
#define SHCNF_FLUSH 0x1000
#define SHCNF_FLUSHNOWAIT 0x2000
typedef struct _FILECHANGEINFO {
DWORD cbSize; // Size of this structure
LONG wEventId; // File System Notification flags
ULONG uFlags; // Flags
DWORD dwItem1;
DWORD dwItem2;
DWORD dwAttributes; // File attributes
FILETIME ftModified; // Modified time
ULONG nFileSize;
} FILECHANGEINFO, * LPFILECHANGEINFO;
typedef const FILECHANGEINFO * LPCFILECHANGEINFO;
#define WM_FILECHANGEINFO (WM_APP + 0x101)
typedef struct tagFILECHANGENOTIFY {
DWORD dwRefCount;
FILECHANGEINFO fci;
} FILECHANGENOTIFY;
typedef struct tagSHCHANGENOTIFYENTRY {
DWORD dwEventMask; // Events to watch
LPTSTR pszWatchDir; // Directory or root for the events we want. NULL means all.
BOOL fRecursive; // Indicates whether look just for pszWatchDir or recursively.
} SHCHANGENOTIFYENTRY;
//
// APIs
//
WINSHELLAPI void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags,
LPCVOID dwItem1, LPCVOID dwItem2);
BOOL WINAPI SHChangeNotifyRegister( HWND hwnd, SHCHANGENOTIFYENTRY *pshcne);
BOOL WINAPI SHChangeNotifyDeregister( HWND hwnd );
void WINAPI SHChangeNotifyFree( FILECHANGENOTIFY *pfcn );
#endif
// ------------------------------------------------ //
#define MAX_LOADSTRING 256
//extern HINSTANCE g_hInst;
// global helpers
void SetFormatSize(DWORD dwSize, TCHAR szBuff[64], LPTSTR pszFmtKB, LPTSTR pszFmtMB);
void SetFormatDouble(LPTSTR pszDouble, UINT nSize);
void SetFormatDateTime(SYSTEMTIME* pst, LPTSTR pszBuff, UINT nSize);
HFONT CreatePointFont(int nPointSize, LPCTSTR pszFaceName, BOOL fBold);
// class CWinceHepler
class CWinceHepler
{
public:
BOOL IsWM5(void);
CWinceHepler();
~CWinceHepler();
BOOL IsPocketPC() {return m_bPocketPC;}
// BOOL DefDlgPaintProc(HWND hDlg, WPARAM wParam, LPARAM lParam);
BOOL DefDlgCtlColorStaticProc(HWND hDlg, WPARAM wParam, LPARAM lParam);
void SHInitDialog(HWND hwndDlg);
HWND SHCreateMenuBar(HWND hwndParent, HINSTANCE hInst, int nMenuID, int nBmpID, int cBmpImages, DWORD dwFlags=0);
int SipPanelHeight();
int LoadString(UINT uID, LPTSTR lpBuffer, int cchBufferMax);
BOOL SHChangeNotifyRegister(HWND hwnd,SHCHANGENOTIFYENTRY * pshcne);
BOOL SHChangeNotifyDeregister(HWND hwnd);
void SHChangeNotifyFree(FILECHANGENOTIFY *pfcn);
protected:
HINSTANCE m_hAygShell;
BOOL (*m_pSHInitDialog)(PSHINITDLGINFO pshidi);
BOOL (*m_pSHCreateMenuBar)(PSHMENUBARINFO pmb);
BOOL (*m_pSHInitExtraControls)(void);
BOOL (*m_pSHChangeNotifyRegister)(HWND hwnd,SHCHANGENOTIFYENTRY * pshcne);
BOOL (*m_pSHChangeNotifyDeregister)(HWND hwnd);
void (*m_pSHChangeNotifyFree)(FILECHANGENOTIFY *pfcn);
HINSTANCE m_hCoreDll;
BOOL (*m_pSipGetInfo)(SIPINFO *pSipInfo);
BOOL m_bPocketPC;
BOOL m_bPPC2K3_SE;
BOOL m_bWM5;
HINSTANCE m_hCeShell;
HINSTANCE m_hNote_Prj;
static BOOL CALLBACK DummyProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
};
#endif // __WCEHELPER_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -