📄 cmdbarband.h
字号:
//======================================================================
// Header file
//
// Written for the book Programming Windows CE
// Copyright (C) 2007 Douglas Boling
//======================================================================
// Returns number of elements
#define dim(x) (sizeof(x) / sizeof(x[0]))
//----------------------------------------------------------------------
// Generic defines and data types
//
struct decodeUINT { // Structure associates
UINT Code; // messages
// with a function.
LRESULT (*Fxn)(HWND, UINT, WPARAM, LPARAM);
};
struct decodeCMD { // Structure associates
UINT Code; // menu IDs with a
LRESULT (*Fxn)(HWND, WORD, HWND, WORD); // function.
};
//----------------------------------------------------------------------
// Defines used by application
//
#define IDC_CMDBAND 1 // Command band ID
#define IDC_CMDBAR 2 // Command bar ID
#define ID_MENU 11 // Main menu resource ID
#define IDC_EDITCTL 12
#define IDC_COMBO 13 // Combo box on cmd bar ID
#define IDB_CMDBAND 50 // Base ID for bands
// Menu item IDs
#define IDM_EXIT 100
#define IDM_VIEWCMDBAR 110
#define IDM_VIEWCMDBAND 111
// Command bar button IDs
#define IDC_LICON 301
#define IDC_SICON 302
#define IDC_LIST 303
#define IDC_RPT 304
#define IDC_SNAME 305
#define IDC_STYPE 306
#define IDC_SSIZE 307
#define IDC_SDATE 308
#define IDC_DPSORT 350
//
#define NUMBANDS 3
//
#define STD_BMPS (STD_PRINT+1) // Number of bmps in
#define VIEW_BMPS (VIEW_NEWFOLDER+1) // Number of bmps in
// view imglist
//----------------------------------------------------------------------
// Function prototypes
//
int CreateCommandBar (HWND hWnd);
int CreateCommandBand (HWND hWnd, BOOL fFirst);
int DestroyCommandBand (HWND hWnd);
HWND InitInstance (HINSTANCE, LPWSTR, int);
int TermInstance (HINSTANCE, int);
// Window procedures
LRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM);
// Message handlers
LRESULT DoCreateMain (HWND, UINT, WPARAM, LPARAM);
LRESULT DoPaintMain (HWND, UINT, WPARAM, LPARAM);
LRESULT DoNotifyMain (HWND, UINT, WPARAM, LPARAM);
LRESULT DoCommandMain (HWND, UINT, WPARAM, LPARAM);
LRESULT DoDestroyMain (HWND, UINT, WPARAM, LPARAM);
// Command functions
LPARAM DoMainCommandVCmdBar (HWND, WORD, HWND, WORD);
LPARAM DoMainCommandVCmdBand (HWND, WORD, HWND, WORD);
LPARAM DoMainCommandExit (HWND, WORD, HWND, WORD);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -