diff options
Diffstat (limited to 'plugins/KeyboardNotify/src')
-rw-r--r-- | plugins/KeyboardNotify/src/EnumProc.cpp | 12 | ||||
-rw-r--r-- | plugins/KeyboardNotify/src/EnumProc.h | 2 | ||||
-rw-r--r-- | plugins/KeyboardNotify/src/flash.cpp | 88 | ||||
-rw-r--r-- | plugins/KeyboardNotify/src/flash.h | 8 | ||||
-rw-r--r-- | plugins/KeyboardNotify/src/keyboard.cpp | 4 | ||||
-rw-r--r-- | plugins/KeyboardNotify/src/main.cpp | 24 | ||||
-rw-r--r-- | plugins/KeyboardNotify/src/options.cpp | 100 | ||||
-rw-r--r-- | plugins/KeyboardNotify/src/utils.cpp | 4 | ||||
-rw-r--r-- | plugins/KeyboardNotify/src/utils.h | 2 |
9 files changed, 122 insertions, 122 deletions
diff --git a/plugins/KeyboardNotify/src/EnumProc.cpp b/plugins/KeyboardNotify/src/EnumProc.cpp index 527e4fda05..e1056113e4 100644 --- a/plugins/KeyboardNotify/src/EnumProc.cpp +++ b/plugins/KeyboardNotify/src/EnumProc.cpp @@ -18,8 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-BOOL findFilename(TCHAR *);
-TCHAR *filename(TCHAR *);
+BOOL findFilename(wchar_t *);
+wchar_t *filename(wchar_t *);
// Globals
extern PROCESS_LIST ProcessList;
@@ -40,7 +40,7 @@ BOOL areThereProcessesRunning(void) // While there are processes, keep looping.
for (procentry.dwSize=sizeof(PROCESSENTRY32), bFlag=Process32First(hSnapShot, &procentry); bFlag; procentry.dwSize=sizeof(PROCESSENTRY32), bFlag=Process32Next(hSnapShot, &procentry)) {
- TCHAR *szFileNameAux = filename(procentry.szExeFile);
+ wchar_t *szFileNameAux = filename(procentry.szExeFile);
// Search szFileName in user-defined list
if (findFilename(szFileNameAux))
@@ -50,7 +50,7 @@ BOOL areThereProcessesRunning(void) return FALSE;
}
-BOOL findFilename(TCHAR *fileName)
+BOOL findFilename(wchar_t *fileName)
{
for (int i=0; i < ProcessList.count; i++)
if (ProcessList.szFileName[i] && !_wcsicmp(ProcessList.szFileName[i], fileName))
@@ -60,9 +60,9 @@ BOOL findFilename(TCHAR *fileName) }
-TCHAR *filename(TCHAR *fullFileName)
+wchar_t *filename(wchar_t *fullFileName)
{
- TCHAR *str;
+ wchar_t *str;
str = wcsrchr(fullFileName, '\\');
if (!str)
diff --git a/plugins/KeyboardNotify/src/EnumProc.h b/plugins/KeyboardNotify/src/EnumProc.h index 489ce06fd6..5f401ce9e0 100644 --- a/plugins/KeyboardNotify/src/EnumProc.h +++ b/plugins/KeyboardNotify/src/EnumProc.h @@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct {
int count;
- TCHAR **szFileName;
+ wchar_t **szFileName;
} PROCESS_LIST;
BOOL areThereProcessesRunning(void);
diff --git a/plugins/KeyboardNotify/src/flash.cpp b/plugins/KeyboardNotify/src/flash.cpp index c2a22d11bf..bbbcc84da4 100644 --- a/plugins/KeyboardNotify/src/flash.cpp +++ b/plugins/KeyboardNotify/src/flash.cpp @@ -33,7 +33,7 @@ FLASHING_SEQUENCE *getTrillianSeq(void); void updateTrillianSeq(void);
static void __cdecl TestThread(void *param);
static void PreviewThread(void *);
-FLASHING_SEQUENCE str2FS(TCHAR *);
+FLASHING_SEQUENCE str2FS(wchar_t *);
BYTE KbdChar2Byte(char);
void countUnopenEvents(int *, int *, int *, int *);
@@ -195,11 +195,11 @@ void updateTrillianSeq(void) }
}
-void useExternSequence(TCHAR *extStr)
+void useExternSequence(wchar_t *extStr)
{
static FLASHING_SEQUENCE Extern = {0};
- TCHAR externStr[MAX_PATH+1];
+ wchar_t externStr[MAX_PATH+1];
mir_wstrcpy(externStr, extStr);
Extern = str2FS(normalizeCustomString(externStr));
@@ -209,98 +209,98 @@ void useExternSequence(TCHAR *extStr) }
-TCHAR *normalizeCustomString(TCHAR *customStr)
+wchar_t *normalizeCustomString(wchar_t *customStr)
{
int len=0, status=0;
BOOL used[4];
- TCHAR strAux[MAX_PATH+1], *str;
+ wchar_t strAux[MAX_PATH+1], *str;
for (mir_wstrcpy(str=strAux, customStr); *str; str++) {
switch (*str) {
- case _T('['):
+ case '[':
if (status == 0) {
status = 1;
customStr[len++] = *str;
used[0] = used [1] = used[2] = used[3] = FALSE;
}
break;
- case _T(']'):
+ case ']':
if (status == 1) {
status = 0;
customStr[len++] = *str;
}
break;
- case _T('0'):
- case _T('1'):
- case _T('2'):
- case _T('3'):
+ case '0':
+ case '1':
+ case '2':
+ case '3':
if (status == 0)
customStr[len++] = *str;
- else if (!used[*str - _T('0')]) {
+ else if (!used[*str - '0']) {
customStr[len++] = *str;
- used[*str - _T('0')] = TRUE;
+ used[*str - '0'] = TRUE;
}
break;
}
}
if (status == 1)
- customStr[len++] = _T(']');
- customStr[len] = _T('\0');
+ customStr[len++] = ']';
+ customStr[len] = '\0';
return customStr;
}
-TCHAR* getCurrentSequenceString(void)
+wchar_t* getCurrentSequenceString(void)
{
- static TCHAR CurrentSeqString[MAX_PATH+1];
- TCHAR *str = CurrentSeqString;
+ static wchar_t CurrentSeqString[MAX_PATH+1];
+ wchar_t *str = CurrentSeqString;
for (unsigned i=0; i < pFS->size; i++) {
switch (pFS->frame[i]) {
case 0:
- *(str++) = _T('0');
+ *(str++) = '0';
break;
case 1:
- *(str++) = _T('3');
+ *(str++) = '3';
break;
case 2:
- *(str++) = _T('1');
+ *(str++) = '1';
break;
case 3:
- *(str++) = _T('[');
- *(str++) = _T('1');
- *(str++) = _T('3');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '1';
+ *(str++) = '3';
+ *(str++) = ']';
break;
case 4:
- *(str++) = _T('2');
+ *(str++) = '2';
break;
case 5:
- *(str++) = _T('[');
- *(str++) = _T('2');
- *(str++) = _T('3');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '2';
+ *(str++) = '3';
+ *(str++) = ']';
break;
case 6:
- *(str++) = _T('[');
- *(str++) = _T('1');
- *(str++) = _T('2');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '1';
+ *(str++) = '2';
+ *(str++) = ']';
break;
case 7:
- *(str++) = _T('[');
- *(str++) = _T('1');
- *(str++) = _T('2');
- *(str++) = _T('3');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '1';
+ *(str++) = '2';
+ *(str++) = '3';
+ *(str++) = ']';
}
}
- *str = _T('\0');
+ *str = '\0';
return CurrentSeqString;
}
-void testSequence(TCHAR *testStr)
+void testSequence(wchar_t *testStr)
{
if (bTestSemaphore) // we try to avoid concurrent test threads
return;
@@ -362,15 +362,15 @@ static void PreviewThread(void*) }
-FLASHING_SEQUENCE str2FS(TCHAR *str)
+FLASHING_SEQUENCE str2FS(wchar_t *str)
{
FLASHING_SEQUENCE Temp = {0};
for (Temp.size=Temp.index=0; *str; str++) {
Temp.size++;
- if (*str == _T('[')) {
+ if (*str == '[') {
Temp.frame[Temp.size - 1] = 0;
- for (str++; *str && *str != _T(']'); str++)
+ for (str++; *str && *str != ']'; str++)
Temp.frame[Temp.size - 1] += KbdChar2Byte(*str) & Leds2Flash;
if (!*str) break;
}
diff --git a/plugins/KeyboardNotify/src/flash.h b/plugins/KeyboardNotify/src/flash.h index f60706fc76..96421c966e 100644 --- a/plugins/KeyboardNotify/src/flash.h +++ b/plugins/KeyboardNotify/src/flash.h @@ -19,10 +19,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void RestoreLEDState(void);
BYTE getBlinkingLeds(void);
void setFlashingSequence(void);
-void useExternSequence(TCHAR *);
-TCHAR *normalizeCustomString(TCHAR *);
-TCHAR *getCurrentSequenceString(void);
-void testSequence(TCHAR *);
+void useExternSequence(wchar_t *);
+wchar_t *normalizeCustomString(wchar_t *);
+wchar_t *getCurrentSequenceString(void);
+void testSequence(wchar_t *);
void previewFlashing(BOOL);
#define LedState(a) (((BYTE)(GetKeyState(a) & 0xffff))!=0)
diff --git a/plugins/KeyboardNotify/src/keyboard.cpp b/plugins/KeyboardNotify/src/keyboard.cpp index 8fd9325b5f..5fd5116dc5 100644 --- a/plugins/KeyboardNotify/src/keyboard.cpp +++ b/plugins/KeyboardNotify/src/keyboard.cpp @@ -37,7 +37,7 @@ typedef struct _KEYBOARD_INDICATOR_PARAMETERS { BOOL OpenKeyboardDevice()
{
int i = 0;
- TCHAR aux1[MAX_PATH+1], aux2[MAX_PATH+1];
+ wchar_t aux1[MAX_PATH+1], aux2[MAX_PATH+1];
do {
mir_sntprintf(aux1, L"Kbd%d", i);
@@ -74,7 +74,7 @@ BOOL ToggleKeyboardLights(BYTE byte) void CloseKeyboardDevice()
{
int i = 0;
- TCHAR aux[MAX_PATH+1];
+ wchar_t aux[MAX_PATH+1];
do {
if (hKbdDev[i] != INVALID_HANDLE_VALUE)
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 9bccd96da1..3cafb2523b 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -463,7 +463,7 @@ static INT_PTR StartBlinkService(WPARAM wParam, LPARAM lParam) nExternCount += (unsigned int)wParam;
if (bFlashOnOther && checkNotifyOptions() && checkGlobalStatus() && checkGlobalXstatus()) {
if (lParam)
- useExternSequence((TCHAR *)lParam);
+ useExternSequence((wchar_t *)lParam);
SetEvent(hFlashEvent);
}
@@ -490,10 +490,10 @@ static INT_PTR IsFlashingActiveService(WPARAM, LPARAM) INT_PTR NormalizeSequenceService(WPARAM, LPARAM lParam)
{
- TCHAR strAux[MAX_PATH + 1], *strIn = (TCHAR*)lParam;
+ wchar_t strAux[MAX_PATH + 1], *strIn = (wchar_t*)lParam;
- _tcsncpy_s(strAux, strIn, _TRUNCATE);
- _tcsncpy_s(strIn, MAX_PATH, normalizeCustomString(strAux), _TRUNCATE);
+ wcsncpy_s(strAux, strIn, _TRUNCATE);
+ wcsncpy_s(strIn, MAX_PATH, normalizeCustomString(strAux), _TRUNCATE);
return (INT_PTR)strIn;
}
@@ -518,7 +518,7 @@ void createProcessList(void) int count = db_get_w(NULL, KEYBDMODULE, "processcount", 0);
ProcessList.count = 0;
- ProcessList.szFileName = (TCHAR **)mir_alloc(count * sizeof(TCHAR *));
+ ProcessList.szFileName = (wchar_t **)mir_alloc(count * sizeof(wchar_t *));
if (ProcessList.szFileName) {
for (int i = 0; i < count; i++)
ProcessList.szFileName[i] = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i));
@@ -820,20 +820,20 @@ static void destroyProtocolList(void) // We use the profile name to create the first part of each event name
// We do so to avoid problems between different instances of the plugin concurrently running
-void createEventPrefix(TCHAR *prefixName, size_t maxLen)
+void createEventPrefix(wchar_t *prefixName, size_t maxLen)
{
size_t len;
- TCHAR profileName[MAX_PATH + 1], *str;
+ wchar_t profileName[MAX_PATH + 1], *str;
getAbsoluteProfileName(profileName, MAX_PATH);
- while (str = _tcschr(profileName, _T('\\')))
- *str = _T('/');
+ while (str = wcschr(profileName, '\\'))
+ *str = '/';
if ((len = mir_tstrlen(profileName)) <= maxLen)
- _tcsncpy_s(prefixName, maxLen, profileName, _TRUNCATE);
+ wcsncpy_s(prefixName, maxLen, profileName, _TRUNCATE);
else {
str = profileName + len - maxLen / 2;
- _tcsncpy_s(prefixName, (maxLen / 2), profileName, _TRUNCATE);
+ wcsncpy_s(prefixName, (maxLen / 2), profileName, _TRUNCATE);
mir_tstrcat(prefixName, str);
}
}
@@ -907,7 +907,7 @@ static int OnPreshutdown(WPARAM, LPARAM) static int ModulesLoaded(WPARAM, LPARAM)
{
- TCHAR eventPrefix[MAX_PATH + 1], eventName[MAX_PATH + 1];
+ wchar_t eventPrefix[MAX_PATH + 1], eventName[MAX_PATH + 1];
createProtocolList();
LoadSettings();
diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index afd15ae342..5f5f0bd92d 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -34,66 +34,66 @@ extern PROCESS_LIST ProcessList; HWND hwndProto, hwndBasic, hwndEffect, hwndTheme, hwndIgnore, hwndCurrentTab; -TCHAR *AttendedName[]={L"Miranda", L"Windows"}; -TCHAR *OrderName[]={LPGENT("left -> right"), LPGENT("right -> left"), LPGENT("left <-> right")}; +wchar_t *AttendedName[]={L"Miranda", L"Windows"}; +wchar_t *OrderName[]={LPGENW("left -> right"), LPGENW("right -> left"), LPGENW("left <-> right")}; PROCESS_LIST ProcessListAux; XSTATUS_INFO *XstatusListAux; BYTE trillianLedsMsg, trillianLedsURL, trillianLedsFile, trillianLedsOther; -static void writeThemeToCombo(const TCHAR *theme, const TCHAR *custom, BOOL overrideExisting) +static void writeThemeToCombo(const wchar_t *theme, const wchar_t *custom, BOOL overrideExisting) { int item = SendDlgItemMessage(hwndTheme, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); if (item == CB_ERR) { item = SendDlgItemMessage(hwndTheme, IDC_THEME, CB_ADDSTRING, 0, (LPARAM)theme); - TCHAR *str = mir_tstrdup(custom); + wchar_t *str = mir_tstrdup(custom); SendDlgItemMessage(hwndTheme, IDC_THEME, CB_SETITEMDATA, (WPARAM)item, (LPARAM)str); } else if (overrideExisting) { - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndTheme, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndTheme, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) mir_tstrcpy(str, custom); } } -void exportThemes(const TCHAR *filename) +void exportThemes(const wchar_t *filename) { - FILE *fExport = _tfopen(filename, L"wt"); + FILE *fExport = _wfopen(filename, L"wt"); if (!fExport) return; fwprintf(fExport, TranslateT("\n; Automatically generated Keyboard Notify Theme file\n\n\n")); - TCHAR *szTheme; + wchar_t *szTheme; for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { - _ftprintf(fExport, L"[%s]\n", szTheme); + fwprintf(fExport, L"[%s]\n", szTheme); mir_free(szTheme); if (szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i))) { - _ftprintf(fExport, L"%s\n\n", szTheme); + fwprintf(fExport, L"%s\n\n", szTheme); mir_free(szTheme); } else - _ftprintf(fExport, L"0\n\n"); + fwprintf(fExport, L"0\n\n"); } - _ftprintf(fExport, TranslateT("\n; End of automatically generated Keyboard Notify Theme file\n")); + fwprintf(fExport, TranslateT("\n; End of automatically generated Keyboard Notify Theme file\n")); fclose(fExport); } -void importThemes(const TCHAR *filename, BOOL overrideExisting) +void importThemes(const wchar_t *filename, BOOL overrideExisting) { - FILE *fImport = _tfopen(filename, L"rt"); + FILE *fImport = _wfopen(filename, L"rt"); if (!fImport) return; int status = 0; size_t i; - TCHAR buffer[MAX_PATH + 1], theme[MAX_PATH + 1], *str; + wchar_t buffer[MAX_PATH + 1], theme[MAX_PATH + 1], *str; - while (_fgetts(buffer, MAX_PATH, fImport) != NULL) { + while (fgetws(buffer, MAX_PATH, fImport) != NULL) { for (str = buffer; *str && isspace(*str); str++); //ltrim if (!*str || *str == ';') //empty line or comment continue; @@ -119,7 +119,7 @@ void importThemes(const TCHAR *filename, BOOL overrideExisting) static void createProcessListAux(void) { ProcessListAux.count = ProcessList.count; - ProcessListAux.szFileName = (TCHAR **)mir_alloc(ProcessListAux.count * sizeof(TCHAR *)); + ProcessListAux.szFileName = (wchar_t **)mir_alloc(ProcessListAux.count * sizeof(wchar_t *)); if (!ProcessListAux.szFileName) ProcessListAux.count = 0; else @@ -213,7 +213,7 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEPGM), TRUE); break; case CBN_EDITCHANGE: - TCHAR szFileName[MAX_PATH + 1]; + wchar_t szFileName[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_PROGRAMS, szFileName, _countof(szFileName)); int item = SendMessage((HWND)lParam, CB_FINDSTRINGEXACT, -1, (LPARAM)szFileName); if (item == CB_ERR) { //new program @@ -229,7 +229,7 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, break; case IDC_ADDPGM: { - TCHAR szFileName[MAX_PATH + 1]; + wchar_t szFileName[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_PROGRAMS, szFileName, _countof(szFileName)); if (!szFileName[0]) break; @@ -240,7 +240,7 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, break; case IDC_DELETEPGM: { - TCHAR szFileName[MAX_PATH + 1]; + wchar_t szFileName[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_PROGRAMS, szFileName, _countof(szFileName)); int item = SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_FINDSTRINGEXACT, -1, (LPARAM)szFileName); SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_DELETESTRING, (WPARAM)item, 0); @@ -256,12 +256,12 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, destroyProcessListAux(); ProcessListAux.count = SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_GETCOUNT, 0, 0); - ProcessListAux.szFileName = (TCHAR **)mir_alloc(ProcessListAux.count * sizeof(TCHAR *)); + ProcessListAux.szFileName = (wchar_t **)mir_alloc(ProcessListAux.count * sizeof(wchar_t *)); if (!ProcessListAux.szFileName) ProcessListAux.count = 0; else for (int i = 0; i < ProcessListAux.count; i++) { - TCHAR szFileNameAux[MAX_PATH + 1]; + wchar_t szFileNameAux[MAX_PATH + 1]; SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_GETLBTEXT, (WPARAM)i, (LPARAM)szFileNameAux); ProcessListAux.szFileName[i] = mir_tstrdup(szFileNameAux); @@ -337,7 +337,7 @@ static INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam tvis.item.pszText = TranslateT("None"); } else { - TCHAR szDefaultName[1024]; + wchar_t szDefaultName[1024]; CUSTOM_STATUS xstatus = { 0 }; xstatus.cbSize = sizeof(CUSTOM_STATUS); xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR; @@ -864,7 +864,7 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_SEQORDER), FALSE); CheckDlgButton(hwndDlg, IDC_CUSTOM, bFlashEffect == FLASH_CUSTOM ? BST_CHECKED : BST_UNCHECKED); - TCHAR *szTheme; + wchar_t *szTheme; for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { int index = SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme); mir_free(szTheme); @@ -1000,12 +1000,12 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara SendDlgItemMessage(hwndDlg, IDC_THEME, EM_LIMITTEXT, MAX_PATH, 0); SendDlgItemMessage(hwndDlg, IDC_CUSTOMSTRING, EM_LIMITTEXT, MAX_PATH, 0); - TCHAR *szTheme; + wchar_t *szTheme; for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { int index = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme); mir_free(szTheme); if (index != CB_ERR && index != CB_ERRSPACE) { - TCHAR *str = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i)); + wchar_t *str = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i)); if (str) SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETITEMDATA, (WPARAM)index, (LPARAM)str); } @@ -1017,7 +1017,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara EnableWindow(GetDlgItem(hwndDlg, IDC_DELETE), FALSE); else { SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETCURSEL, (WPARAM)wCustomTheme, 0); - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)wCustomTheme, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)wCustomTheme, 0); if (str) SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str); } @@ -1033,7 +1033,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara switch (HIWORD(wParam)) { case CBN_SELENDOK: case CBN_SELCHANGE: { - TCHAR *str = (TCHAR *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0); + wchar_t *str = (wchar_t *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0); if (str) SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str); else @@ -1044,7 +1044,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara } break; case CBN_EDITCHANGE: - TCHAR theme[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme)); int item = SendMessage((HWND)lParam, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); if (item == CB_ERR) { @@ -1054,7 +1054,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara EnableWindow(GetDlgItem(hwndDlg, IDC_DELETE), FALSE); } else { - TCHAR *str = (TCHAR *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)item, 0); if (str) SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str); else @@ -1068,13 +1068,13 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_CUSTOMSTRING: if (HIWORD(wParam) == EN_CHANGE) { - TCHAR theme[MAX_PATH + 1], customAux[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1], customAux[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme)); int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); if (item == CB_ERR) return TRUE; - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) { GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, customAux, _countof(customAux)); if (mir_wstrcmp(str, customAux)) @@ -1086,7 +1086,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_TEST: { - TCHAR custom[MAX_PATH + 1]; + wchar_t custom[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, custom, _countof(custom)); SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, normalizeCustomString(custom)); @@ -1095,13 +1095,13 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_ADD: { - TCHAR theme[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme)); if (!theme[0]) return TRUE; int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_ADDSTRING, 0, (LPARAM)theme); - TCHAR *str = (TCHAR *)mir_alloc((MAX_PATH + 1)*sizeof(TCHAR)); + wchar_t *str = (wchar_t *)mir_alloc((MAX_PATH + 1)*sizeof(wchar_t)); if (str) { GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str, MAX_PATH); SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, normalizeCustomString(str)); @@ -1115,11 +1115,11 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_UPDATE: { - TCHAR theme[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme)); int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) { GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str, MAX_PATH); SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, normalizeCustomString(str)); @@ -1130,11 +1130,11 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_DELETE: { - TCHAR theme[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme)); int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) mir_free(str); SendDlgItemMessage(hwndDlg, IDC_THEME, CB_DELETESTRING, (WPARAM)item, 0); @@ -1145,7 +1145,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara } else { SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETCURSEL, 0, 0); - str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, 0, 0); + str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, 0, 0); if (str) SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str); } @@ -1155,10 +1155,10 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_EXPORT: { - TCHAR path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter; + wchar_t path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter; OPENFILENAME ofn = { 0 }; - path[0] = _T('\0'); + path[0] = '\0'; ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hwndDlg; ofn.hInstance = NULL; @@ -1171,7 +1171,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara pfilter = pfilter + mir_tstrlen(pfilter) + 1; mir_tstrcpy(pfilter, L"*.*"); pfilter = pfilter + mir_tstrlen(pfilter) + 1; - *pfilter = _T('\0'); + *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.lpstrFile = path; ofn.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR | OFN_NOREADONLYRETURN | OFN_PATHMUSTEXIST; @@ -1183,10 +1183,10 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case IDC_IMPORT: { - TCHAR path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter; + wchar_t path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter; OPENFILENAME ofn = { 0 }; - path[0] = _T('\0'); + path[0] = '\0'; ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hwndDlg; ofn.hInstance = NULL; @@ -1199,7 +1199,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara pfilter = pfilter + mir_tstrlen(pfilter) + 1; mir_tstrcpy(pfilter, L"*.*"); pfilter = pfilter + mir_tstrlen(pfilter) + 1; - *pfilter = _T('\0'); + *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.lpstrFile = path; ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR; @@ -1220,7 +1220,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara case WM_NOTIFY: { int count; - TCHAR theme[MAX_PATH + 1], themeAux[MAX_PATH + 1]; + wchar_t theme[MAX_PATH + 1], themeAux[MAX_PATH + 1]; // Here we have pressed either the OK or the APPLY button. switch (((LPNMHDR)lParam)->idFrom) { case 0: @@ -1231,7 +1231,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara mir_free(szTheme); } else - theme[0] = _T('\0'); + theme[0] = '\0'; // Here we will delete all the items in the theme combo on the Flashing tab: we will load them again later for (int i = 0; SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_DELETESTRING, 0, (LPARAM)i) != CB_ERR; i++); @@ -1240,7 +1240,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara for (int i = 0; i < count; i++) { SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETLBTEXT, (WPARAM)i, (LPARAM)themeAux); db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), themeAux); - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)i, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)i, 0); if (str) db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), str); else @@ -1274,7 +1274,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara int count = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETCOUNT, 0, 0); for (int item = 0; item < count; item++) { - TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); + wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) mir_free(str); } diff --git a/plugins/KeyboardNotify/src/utils.cpp b/plugins/KeyboardNotify/src/utils.cpp index 23b9408ff2..b7d59819b8 100644 --- a/plugins/KeyboardNotify/src/utils.cpp +++ b/plugins/KeyboardNotify/src/utils.cpp @@ -31,9 +31,9 @@ char *fmtDBSettingName(const char *fmt, ...) }
-TCHAR *getAbsoluteProfileName(TCHAR *absoluteProfileName, size_t maxLen)
+wchar_t *getAbsoluteProfileName(wchar_t *absoluteProfileName, size_t maxLen)
{
- TCHAR profilePath[MAX_PATH+1], profileName[MAX_PATH+1];
+ wchar_t profilePath[MAX_PATH+1], profileName[MAX_PATH+1];
profilePath[0] = profileName[0] = '\0';
CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath);
diff --git a/plugins/KeyboardNotify/src/utils.h b/plugins/KeyboardNotify/src/utils.h index 66917754ed..64e83feeb5 100644 --- a/plugins/KeyboardNotify/src/utils.h +++ b/plugins/KeyboardNotify/src/utils.h @@ -17,4 +17,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
char *fmtDBSettingName(const char *, ...);
-TCHAR *getAbsoluteProfileName(TCHAR *, size_t);
+wchar_t *getAbsoluteProfileName(wchar_t *, size_t);
|