return FALSE;\r
}\r
\r
-void CProfile::SaveKeyBind(const CString szApplicationName, const int nComID, const int nType, const int nKey)\r
+void CProfile::SaveKeyBind(const LPCSTR szAppName, const int nComID, const int nType, const int nKey)\r
{\r
- if (!nComID) {\r
+ if (!nComID)\r
return;\r
- }\r
-\r
- CString szCommandName = CCommands::GetCommandName(nComID);\r
- if (szCommandName.IsEmpty()) {\r
+ const LPCSTR szComName = CCommands::GetCommandName(nComID);\r
+ if (!szComName[0])\r
return;\r
- }\r
-\r
- SaveKeyBind(szApplicationName, szCommandName, nType, nKey);\r
+ SaveKeyBind(szAppName, szComName, nType, nKey);\r
}\r
\r
-void CProfile::SaveKeyBind(const CString szApplicationName, const CString szCommandName, const int nType, const int nKey)\r
+void CProfile::SaveKeyBind(const LPCSTR szAppName, const LPCSTR szComName, const int nType, const int nKey)\r
{\r
- CString szKeyBind = WriteKeyBind(nType, nKey);\r
- CString szSubKey(MAKEINTRESOURCE(IDS_REGSUBKEY_DATA));\r
- szSubKey += _T("\\") + szApplicationName + _T("\\") + szCommandName;\r
- if (!szKeyBind.IsEmpty()) {\r
+ const CString szKeyBind = WriteKeyBind(nType, nKey);\r
+ CString szSubKey = CString(MAKEINTRESOURCE(IDS_REGSUBKEY_DATA)) + _T("\\") + szAppName + _T("\\") + szComName;\r
+ if (!szKeyBind.IsEmpty())\r
szSubKey += _T("\\") + szKeyBind;\r
- }\r
-\r
HKEY hKey = NULL;\r
- if (RegCreateKeyEx(HKEY_CURRENT_USER, szSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL) == ERROR_SUCCESS) {\r
+ if (RegCreateKeyEx(HKEY_CURRENT_USER, szSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL) == ERROR_SUCCESS)\r
RegCloseKey(hKey);\r
- }\r
}\r
\r
-void CProfile::SaveCommand(const CString szApplicationName, const int nComID)\r
+void CProfile::SaveCommand(const LPCSTR szAppName, const int nComID)\r
{\r
- SaveKeyBind(szApplicationName, nComID, 0, 0);\r
+ SaveKeyBind(szAppName, nComID, 0, 0);\r
}\r
\r
-void CProfile::AddKeyBind2C_(const CString szApplicationName, const BYTE bVk)\r
+void CProfile::AddKeyBind2C_(const LPCSTR szAppName, const BYTE bVk)\r
{\r
int nComID;\r
- for (nComID = 0; nComID < MAX_COMMAND; ++nComID) {\r
- if (Commands[nComID].fCommand == CCommands::C_) {\r
+ for (nComID = 0; nComID < MAX_COMMAND; ++nComID)\r
+ if (Commands[nComID].fCommand == CCommands::C_)\r
break;\r
- }\r
- }\r
-\r
- SaveKeyBind(szApplicationName, nComID, NONE, bVk);\r
+ SaveKeyBind(szAppName, nComID, NONE, bVk);\r
}\r
\r
void CProfile::LevelUp()\r
static void SaveData();\r
\r
private:\r
- static void SaveKeyBind(CString szApplicationName, CString szCommandName, int nType, int nKey);\r
+ static void SaveKeyBind(const LPCSTR szAppName, const LPCSTR szComName, int nType, int nKey);\r
static BOOL DiableTokenPrivileges();\r
static BOOL AdjustTokenPrivileges(LPCTSTR lpName);\r
- static void SaveCommand(CString szApplicationName, int nComID);\r
- static void SaveKeyBind(CString szApplicationName, int nComID, int nType, int nKey);\r
- static void AddKeyBind2C_(CString szApplicationName, BYTE bVk);\r
+ static void SaveCommand(const LPCSTR szAppName, int nComID);\r
+ static void SaveKeyBind(const LPCSTR szAppName, int nComID, int nType, int nKey);\r
+ static void AddKeyBind2C_(const LPCSTR szApplicationName, BYTE bVk);\r
static void LevelUp();\r
static void Item2AppName(CString *sz);\r
static int IsNotSameString(CComboBox *pApplication, CString szListItem);\r
static DWORD m_dwTasks;\r
static void GetTaskList();\r
static BOOL IsCommandType(int nType, LPCTSTR szKeyBind);\r
- static int KeyBind2Key(LPCTSTR szKey);\r
- static int KeyBind2CommandType(LPCTSTR szKeyBind);\r
+ static int KeyBind2Key(const LPCTSTR szKey);\r
+ static int KeyBind2CommandType(const LPCTSTR szKeyBind);\r
static CString WriteKeyBind(int nType, int nKey);\r
static void LoadRegistry();\r
static void SaveRegistry();\r