-
Notifications
You must be signed in to change notification settings - Fork 1
/
AccelTable.h
62 lines (49 loc) · 1.42 KB
/
AccelTable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyleft 2004 Chris Korda
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or any later version.
/*
chris korda
revision history:
rev date comments
00 04feb05 initial version
wrapper for accelerator table
*/
#ifndef ACCELTABLE_INCLUDED
#define ACCELTABLE_INCLUDED
class CAccelTable {
public:
// Construction
CAccelTable();
~CAccelTable();
// Initialization
bool LoadFromRes(int ResID);
void LoadFromHandle(HACCEL Accel);
void LoadFromTable(const ACCEL *Table, int Entries);
// Attributes
operator bool() const;
operator HACCEL() const;
int GetEntries() const;
int GetTable(ACCEL *Table, int Entries) const;
static bool IsExtended(DWORD Key);
static void GetKeyName(const ACCEL& Accel, CString& KeyName);
static void GetCmdName(const ACCEL& Accel, CString& CmdName);
static void GetCmdHelp(const ACCEL& Accel, CString& CmdHelp);
protected:
// Member data
HACCEL m_Accel; // if non-NULL, handle to an accelerator table
bool m_Destroy; // true if we're responsible for destroying table
// Helpers
void Cleanup();
static CString GetKeyNameText(LONG lParam);
NOCOPIES(CAccelTable);
};
inline CAccelTable::operator bool() const
{
return(m_Accel != NULL);
}
inline CAccelTable::operator HACCEL() const
{
return(m_Accel);
}
#endif