summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
commit6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch)
tree2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/AutoShutdown/src
parenta61c8728b379057fe7f0a0d86fe0b037598229dd (diff)
less TCHARs:
- TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown/src')
-rw-r--r--plugins/AutoShutdown/src/cpuusage.cpp2
-rw-r--r--plugins/AutoShutdown/src/frame.cpp10
-rw-r--r--plugins/AutoShutdown/src/options.cpp6
-rw-r--r--plugins/AutoShutdown/src/settingsdlg.cpp18
-rw-r--r--plugins/AutoShutdown/src/shutdownsvc.cpp60
-rw-r--r--plugins/AutoShutdown/src/utils.cpp16
-rw-r--r--plugins/AutoShutdown/src/utils.h6
-rw-r--r--plugins/AutoShutdown/src/watcher.cpp6
8 files changed, 62 insertions, 62 deletions
diff --git a/plugins/AutoShutdown/src/cpuusage.cpp b/plugins/AutoShutdown/src/cpuusage.cpp
index 7ca145d875..d5cfa13b05 100644
--- a/plugins/AutoShutdown/src/cpuusage.cpp
+++ b/plugins/AutoShutdown/src/cpuusage.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define Li2Double(x) ((double)((x).HighPart)*4.294967296E9+(double)((x).LowPart))
-static BOOL WinNT_PerfStatsSwitch(TCHAR *pszServiceName, BOOL fDisable)
+static BOOL WinNT_PerfStatsSwitch(wchar_t *pszServiceName, BOOL fDisable)
{
HKEY hKeyServices, hKeyService, hKeyPerf;
DWORD dwData, dwDataSize;
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp
index 0f76cb66fa..972102796f 100644
--- a/plugins/AutoShutdown/src/frame.cpp
+++ b/plugins/AutoShutdown/src/frame.cpp
@@ -327,7 +327,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
dat->flags |= FWPDF_PAUSEDSHOWN;
}
else {
- TCHAR szOutput[256];
+ wchar_t szOutput[256];
if (dat->fTimeFlags&SDWTF_ST_TIME)
GetFormatedDateTime(szOutput, _countof(szOutput), dat->settingLastTime, TRUE);
else GetFormatedCountdown(szOutput, _countof(szOutput), dat->countdown);
@@ -414,7 +414,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
HDC hdc;
SIZE size;
HFONT hFontPrev = NULL;
- TCHAR szOutput[256];
+ wchar_t szOutput[256];
dat->flags &= ~FWPDF_TIMEISCLIPPED;
if (GetWindowText(dat->hwndTime, szOutput, _countof(szOutput)))
if (GetClientRect(dat->hwndTime, &rc)) {
@@ -464,7 +464,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
else if ((HWND)wParam == dat->hwndIcon)
ttdi->lpszText = TranslateT("Automatic shutdown");
else {
- TCHAR szTime[_countof(ttdi->szText)];
+ wchar_t szTime[_countof(ttdi->szText)];
if (dat->fTimeFlags&SDWTF_ST_TIME)
GetFormatedDateTime(szTime, _countof(szTime), dat->settingLastTime, FALSE);
else GetFormatedCountdown(szTime, _countof(szTime), dat->countdown);
@@ -556,9 +556,9 @@ static int FrameModulesLoaded(WPARAM, LPARAM)
LOGFONT lf;
/* built-in font module is not available before this hook */
COLORREF clr = GetDefaultColor(FRAMEELEMENT_TEXT);
- FontService_RegisterFont("AutoShutdown", "CountdownFont", LPGENT("Automatic shutdown"), LPGENT("Countdown on frame"), LPGENT("Automatic shutdown"), LPGENT("Background"), 0, FALSE, GetDefaultFont(&lf), clr);
+ FontService_RegisterFont("AutoShutdown", "CountdownFont", LPGENW("Automatic shutdown"), LPGENW("Countdown on frame"), LPGENW("Automatic shutdown"), LPGENW("Background"), 0, FALSE, GetDefaultFont(&lf), clr);
clr = GetDefaultColor(FRAMEELEMENT_BKGRND);
- FontService_RegisterColor("AutoShutdown", "BkgColor", LPGENT("Automatic shutdown"), LPGENT("Background"), clr);
+ FontService_RegisterColor("AutoShutdown", "BkgColor", LPGENW("Automatic shutdown"), LPGENW("Background"), clr);
if (!IsThemeActive()) {
/* progressbar color can only be changed with classic theme */
clr = GetDefaultColor(FRAMEELEMENT_BAR);
diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp
index 9dc562eed4..358f3e04af 100644
--- a/plugins/AutoShutdown/src/options.cpp
+++ b/plugins/AutoShutdown/src/options.cpp
@@ -110,9 +110,9 @@ static int ShutdownOptInit(WPARAM wParam, LPARAM)
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SHUTDOWN);
odp.position = 900000002;
- odp.ptszGroup = LPGENT("Events"); /* autotranslated */
- odp.ptszTitle = LPGENT("Automatic shutdown"); /* autotranslated */
- odp.ptszTab = LPGENT("Automatic shutdown"); /* autotranslated, can be made a tab */
+ odp.pwszGroup = LPGENW("Events"); /* autotranslated */
+ odp.pwszTitle = LPGENW("Automatic shutdown"); /* autotranslated */
+ odp.pwszTab = LPGENW("Automatic shutdown"); /* autotranslated, can be made a tab */
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = ShutdownOptDlgProc;
Options_AddPage(wParam, &odp);
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp
index 594c008a54..33a4e647c4 100644
--- a/plugins/AutoShutdown/src/settingsdlg.cpp
+++ b/plugins/AutoShutdown/src/settingsdlg.cpp
@@ -30,7 +30,7 @@ static HWND hwndSettingsDlg;
extern HINSTANCE hInst;
const DWORD unitValues[] = { 1,60,60 * 60,60 * 60 * 24,60 * 60 * 24 * 7,60 * 60 * 24 * 31 };
-const TCHAR *unitNames[] = { LPGENT("Second(s)"), LPGENT("Minute(s)"), LPGENT("Hour(s)"), LPGENT("Day(s)"), LPGENT("Week(s)"), LPGENT("Month(s)") };
+const wchar_t *unitNames[] = { LPGENW("Second(s)"), LPGENW("Minute(s)"), LPGENW("Hour(s)"), LPGENW("Day(s)"), LPGENW("Week(s)"), LPGENW("Month(s)") };
/************************* Dialog *************************************/
@@ -47,7 +47,7 @@ static BOOL CALLBACK DisplayCpuUsageProc(BYTE nCpuUsage, LPARAM lParam)
if (!IsWindow((HWND)lParam))
return FALSE; /* stop poll thread */
- TCHAR str[64];
+ wchar_t str[64];
mir_sntprintf(str, TranslateT("(current: %u%%)"), nCpuUsage);
SetWindowText((HWND)lParam, str);
return TRUE;
@@ -152,7 +152,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
SendMessage(hwndCombo, CB_INITSTORAGE, SDSDT_MAX, SDSDT_MAX * 32);
for (BYTE shutdownType = 1; shutdownType <= SDSDT_MAX; ++shutdownType)
if (ServiceIsTypeEnabled(shutdownType, 0)) {
- TCHAR *pszText = (TCHAR*)ServiceGetTypeDescription(shutdownType, GSTDF_TCHAR); /* never fails */
+ wchar_t *pszText = (wchar_t*)ServiceGetTypeDescription(shutdownType, GSTDF_TCHAR); /* never fails */
int index = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)pszText);
if (index != LB_ERR) {
SendMessage(hwndCombo, CB_SETITEMDATA, index, (LPARAM)shutdownType);
@@ -241,7 +241,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
case M_UPDATE_SHUTDOWNDESC: /* lParam=(LPARAM)(HWND)hwndCombo */
{
BYTE shutdownType = (BYTE)SendMessage((HWND)lParam, CB_GETITEMDATA, SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0);
- SetDlgItemText(hwndDlg, IDC_TEXT_SHUTDOWNTYPE, (TCHAR*)ServiceGetTypeDescription(shutdownType, GSTDF_LONGDESC | GSTDF_TCHAR));
+ SetDlgItemText(hwndDlg, IDC_TEXT_SHUTDOWNTYPE, (wchar_t*)ServiceGetTypeDescription(shutdownType, GSTDF_LONGDESC | GSTDF_TCHAR));
}
return TRUE;
@@ -352,7 +352,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
{
HWND hwndEdit = GetDlgItem(hwndDlg, IDC_EDIT_MESSAGE);
int len = GetWindowTextLength(hwndEdit) + 1;
- TCHAR *pszText = (TCHAR*)mir_alloc(len*sizeof(TCHAR));
+ wchar_t *pszText = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
if (pszText != NULL && GetWindowText(hwndEdit, pszText, len + 1)) {
TrimString(pszText);
db_set_ts(NULL, "AutoShutdown", "Message", pszText);
@@ -453,23 +453,23 @@ void SetShutdownMenuItem(bool fActive)
mi.position = 2001090000;
if (fActive) {
mi.hIcolibItem = iconList[1].hIcolib;
- mi.name.t = LPGENT("Stop automatic &shutdown");
+ mi.name.w = LPGENW("Stop automatic &shutdown");
}
else {
mi.hIcolibItem = iconList[2].hIcolib;
- mi.name.t = LPGENT("Automatic &shutdown...");
+ mi.name.w = LPGENW("Automatic &shutdown...");
}
mi.pszService = "AutoShutdown/MenuCommand";
mi.flags = CMIF_TCHAR;
if (hMainMenuItem != NULL)
- Menu_ModifyItem(hMainMenuItem, mi.name.t, mi.hIcolibItem);
+ Menu_ModifyItem(hMainMenuItem, mi.name.w, mi.hIcolibItem);
else
hMainMenuItem = Menu_AddMainMenuItem(&mi);
/* tray menu */
mi.position = 899999;
if (hTrayMenuItem != NULL)
- Menu_ModifyItem(hTrayMenuItem, mi.name.t, mi.hIcolibItem);
+ Menu_ModifyItem(hTrayMenuItem, mi.name.w, mi.hIcolibItem);
else
hTrayMenuItem = Menu_AddTrayMenuItem(&mi);
}
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp
index 7a6dafb468..b77aab3558 100644
--- a/plugins/AutoShutdown/src/shutdownsvc.cpp
+++ b/plugins/AutoShutdown/src/shutdownsvc.cpp
@@ -30,20 +30,20 @@ static HANDLE hEventOkToShutdown,hEventShutdown;
/************************* Utils **************************************/
-TCHAR *desc[] =
+wchar_t *desc[] =
{
- LPGENT("Miranda NG is going to be automatically closed in %u second(s)."),
- LPGENT("All Miranda NG protocols are going to be set to offline in %u second(s)."),
- LPGENT("You will be logged off automatically in %u second(s)."),
- LPGENT("The computer will automatically be restarted in %u second(s)."),
- LPGENT("The computer will automatically be set to standby mode in %u second(s)."),
- LPGENT("The computer will automatically be set to hibernate mode in %u second(s)."),
- LPGENT("The workstation will automatically get locked in %u second(s)."),
- LPGENT("All dial-up connections will be closed in %u second(s)."),
- LPGENT("The computer will automatically be shut down in %u second(s).")
+ LPGENW("Miranda NG is going to be automatically closed in %u second(s)."),
+ LPGENW("All Miranda NG protocols are going to be set to offline in %u second(s)."),
+ LPGENW("You will be logged off automatically in %u second(s)."),
+ LPGENW("The computer will automatically be restarted in %u second(s)."),
+ LPGENW("The computer will automatically be set to standby mode in %u second(s)."),
+ LPGENW("The computer will automatically be set to hibernate mode in %u second(s)."),
+ LPGENW("The workstation will automatically get locked in %u second(s)."),
+ LPGENW("All dial-up connections will be closed in %u second(s)."),
+ LPGENW("The computer will automatically be shut down in %u second(s).")
};
-static BOOL WinNT_SetPrivilege(TCHAR *pszPrivName, BOOL bEnable)
+static BOOL WinNT_SetPrivilege(wchar_t *pszPrivName, BOOL bEnable)
{
BOOL bReturn = FALSE;
HANDLE hToken;
@@ -383,7 +383,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
case M_UPDATE_COUNTDOWN: /* lParam=(WORD)countdown */
{
- TCHAR szText[256];
+ wchar_t szText[256];
mir_sntprintf(szText, TranslateTS(desc[shutdownType - 1]), lParam);
SetDlgItemText(hwndDlg, IDC_TEXT_HEADER, szText);
/* countdown finished */
@@ -451,24 +451,24 @@ INT_PTR ServiceIsTypeEnabled(WPARAM wParam, LPARAM)
return IsShutdownTypeEnabled((BYTE)wParam); /* does shutdownType range check */
}
-const TCHAR *apszShort[] = {
- LPGENT("Close Miranda NG"),LPGENT("Set Miranda NG offline"),LPGENT("Log off user"),
- LPGENT("Restart computer"),LPGENT("Shutdown computer"),LPGENT("Standby mode"),LPGENT("Hibernate mode"),
- LPGENT("Lock workstation"),LPGENT("Hang up dial-up connections"),LPGENT("Close Miranda NG"),
- LPGENT("Set Miranda NG offline"),LPGENT("Log off user"),LPGENT("Restart computer"),LPGENT("Shutdown computer"),
- LPGENT("Standby mode"),LPGENT("Hibernate mode"),LPGENT("Lock workstation"),LPGENT("Hang up dial-up connections")
+const wchar_t *apszShort[] = {
+ LPGENW("Close Miranda NG"),LPGENW("Set Miranda NG offline"),LPGENW("Log off user"),
+ LPGENW("Restart computer"),LPGENW("Shutdown computer"),LPGENW("Standby mode"),LPGENW("Hibernate mode"),
+ LPGENW("Lock workstation"),LPGENW("Hang up dial-up connections"),LPGENW("Close Miranda NG"),
+ LPGENW("Set Miranda NG offline"),LPGENW("Log off user"),LPGENW("Restart computer"),LPGENW("Shutdown computer"),
+ LPGENW("Standby mode"),LPGENW("Hibernate mode"),LPGENW("Lock workstation"),LPGENW("Hang up dial-up connections")
};
-const TCHAR *apszLong[] = {
- LPGENT("Sets all Miranda NG protocols to offline and closes Miranda NG."),
- LPGENT("Sets all Miranda NG protocols to offline."),
- LPGENT("Logs the current Windows user off so that another user can log in."),
- LPGENT("Shuts down Windows and then restarts Windows."),
- LPGENT("Closes all running programs and shuts down Windows to a point at which it is safe to turn off the power."),
- LPGENT("Saves the current Windows session in memory and sets the system to suspend mode."),
- LPGENT("Saves the current Windows session on hard drive, so that the power can be turned off."),
- LPGENT("Locks the computer. To unlock the computer, you must log in."),
- LPGENT("Sets all protocols to offline and closes all RAS connections.")
+const wchar_t *apszLong[] = {
+ LPGENW("Sets all Miranda NG protocols to offline and closes Miranda NG."),
+ LPGENW("Sets all Miranda NG protocols to offline."),
+ LPGENW("Logs the current Windows user off so that another user can log in."),
+ LPGENW("Shuts down Windows and then restarts Windows."),
+ LPGENW("Closes all running programs and shuts down Windows to a point at which it is safe to turn off the power."),
+ LPGENW("Saves the current Windows session in memory and sets the system to suspend mode."),
+ LPGENW("Saves the current Windows session on hard drive, so that the power can be turned off."),
+ LPGENW("Locks the computer. To unlock the computer, you must log in."),
+ LPGENW("Sets all protocols to offline and closes all RAS connections.")
};
INT_PTR ServiceGetTypeDescription(WPARAM wParam, LPARAM lParam)
@@ -476,7 +476,7 @@ INT_PTR ServiceGetTypeDescription(WPARAM wParam, LPARAM lParam)
/* shutdownType range check */
if (!wParam || (BYTE)wParam > SDSDT_MAX) return 0;
/* select description */
- TCHAR *pszDesc = (TCHAR*)((lParam&GSTDF_LONGDESC) ? apszLong : apszShort)[wParam - 1];
+ wchar_t *pszDesc = (wchar_t*)((lParam&GSTDF_LONGDESC) ? apszLong : apszShort)[wParam - 1];
if (!(lParam&GSTDF_UNTRANSLATED)) pszDesc = TranslateTS(pszDesc);
/* convert as needed */
if (!(lParam&GSTDF_UNICODE)) {
@@ -496,7 +496,7 @@ void InitShutdownSvc(void)
{
/* Shutdown Dialog */
hwndShutdownDlg = NULL;
- SkinAddNewSoundExT("AutoShutdown_Countdown", LPGENT("Alerts"), LPGENT("Automatic shutdown countdown"));
+ SkinAddNewSoundExT("AutoShutdown_Countdown", LPGENW("Alerts"), LPGENW("Automatic shutdown countdown"));
/* Events */
hEventOkToShutdown = CreateHookableEvent(ME_AUTOSHUTDOWN_OKTOSHUTDOWN);
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp
index 4433831a03..ffe41e4a0a 100644
--- a/plugins/AutoShutdown/src/utils.cpp
+++ b/plugins/AutoShutdown/src/utils.cpp
@@ -47,9 +47,9 @@ char* u2a(const WCHAR *pszUnicode)
return psz;
}
-void TrimString(TCHAR *pszStr)
+void TrimString(wchar_t *pszStr)
{
- TCHAR *psz, szChars[] = L" \r\n\t";
+ wchar_t *psz, szChars[] = L" \r\n\t";
for (int i = 0; i < _countof(szChars); ++i) {
/* trim end */
psz = &pszStr[mir_tstrlen(pszStr) - 1];
@@ -60,7 +60,7 @@ void TrimString(TCHAR *pszStr)
/* trim beginning */
for (psz = pszStr; (*psz && *psz == szChars[i]); psz = CharNext(psz))
;
- memmove(pszStr, psz, (mir_tstrlen(psz) + 1)*sizeof(TCHAR));
+ memmove(pszStr, psz, (mir_tstrlen(psz) + 1)*sizeof(wchar_t));
}
}
@@ -158,7 +158,7 @@ BOOL TimeStampToSystemTime(time_t timestamp, SYSTEMTIME *st)
return TRUE;
}
-BOOL GetFormatedCountdown(TCHAR *pszOut, int nSize, time_t countdown)
+BOOL GetFormatedCountdown(wchar_t *pszOut, int nSize, time_t countdown)
{
static BOOL fInited = FALSE;
static int (WINAPI *pfnGetDurationFormat)(LCID, DWORD, const SYSTEMTIME*, double, WCHAR*, WCHAR*, int);
@@ -183,7 +183,7 @@ BOOL GetFormatedCountdown(TCHAR *pszOut, int nSize, time_t countdown)
return StrFromTimeInterval(pszOut, nSize, (countdown > (MAXDWORD / 1000)) ? MAXDWORD : (countdown * 1000), 10) != 0;
}
-BOOL GetFormatedDateTime(TCHAR *pszOut, int nSize, time_t timestamp, BOOL fShowDateEvenToday)
+BOOL GetFormatedDateTime(wchar_t *pszOut, int nSize, time_t timestamp, BOOL fShowDateEvenToday)
{
SYSTEMTIME st, stNow;
LCID locale = Langpack_GetDefaultLocale();
@@ -194,7 +194,7 @@ BOOL GetFormatedDateTime(TCHAR *pszOut, int nSize, time_t timestamp, BOOL fShowD
return GetTimeFormat(locale, ((st.wSecond == 0) ? TIME_NOSECONDS : 0) | TIME_FORCE24HOURFORMAT, &st, NULL, pszOut, nSize) != 0;
/* show both date and time */
{
- TCHAR szDate[128], szTime[128];
+ wchar_t szDate[128], szTime[128];
if (!GetTimeFormat(locale, ((st.wSecond == 0) ? TIME_NOSECONDS : 0) | TIME_FORCE24HOURFORMAT, &st, NULL, szTime, _countof(szTime)))
return FALSE;
if (!GetDateFormat(locale, DATE_SHORTDATE, &st, NULL, szDate, _countof(szDate)))
@@ -212,8 +212,8 @@ void AddHotkey()
hkd.cbSize = sizeof(hkd);
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "AutoShutdown_Toggle";
- hkd.ptszDescription = LPGENT("Toggle automatic shutdown");
- hkd.ptszSection = LPGENT("Main");
+ hkd.ptszDescription = LPGENW("Toggle automatic shutdown");
+ hkd.ptszSection = LPGENW("Main");
hkd.pszService = "AutoShutdown/MenuCommand";
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'T') | HKF_MIRANDA_LOCAL;
hkd.lParam = FALSE;
diff --git a/plugins/AutoShutdown/src/utils.h b/plugins/AutoShutdown/src/utils.h
index 02edb32dda..d3ccaabae7 100644
--- a/plugins/AutoShutdown/src/utils.h
+++ b/plugins/AutoShutdown/src/utils.h
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* String */
WCHAR *a2u(const char *pszAnsi);
char *u2a(const WCHAR *pszUnicode);
-void TrimString(TCHAR *pszStr);
+void TrimString(wchar_t *pszStr);
/* Error Output */
void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...);
@@ -31,8 +31,8 @@ char* GetWinErrorDescription(DWORD dwLastError);
/* Time */
BOOL SystemTimeToTimeStamp(SYSTEMTIME *st,time_t *timestamp);
BOOL TimeStampToSystemTime(time_t timestamp,SYSTEMTIME *st);
-BOOL GetFormatedCountdown(TCHAR *pszOut,int nSize,time_t countdown);
-BOOL GetFormatedDateTime(TCHAR *pszOut,int nSize,time_t timestamp,BOOL fShowDateEvenToday);
+BOOL GetFormatedCountdown(wchar_t *pszOut,int nSize,time_t countdown);
+BOOL GetFormatedDateTime(wchar_t *pszOut,int nSize,time_t timestamp,BOOL fShowDateEvenToday);
/* Skin */
void AddHotkey();
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp
index efb456a82a..65a69c73f9 100644
--- a/plugins/AutoShutdown/src/watcher.cpp
+++ b/plugins/AutoShutdown/src/watcher.cpp
@@ -63,7 +63,7 @@ static void __inline ShutdownAndStopWatcher(void)
/************************* Msg Shutdown *******************************/
// ppBlob might get reallocated, must have been allocated using mir_alloc()
-static TCHAR* GetMessageText(BYTE **ppBlob, DWORD *pcbBlob)
+static wchar_t* GetMessageText(BYTE **ppBlob, DWORD *pcbBlob)
{
(*ppBlob)[*pcbBlob] = 0;
size_t cb = mir_strlen((char*)*ppBlob);
@@ -102,8 +102,8 @@ static int MsgEventAdded(WPARAM, LPARAM hDbEvent)
DBVARIANT dbv;
if (!db_get_ts(NULL, "AutoShutdown", "Message", &dbv)) {
TrimString(dbv.ptszVal);
- TCHAR *pszMsg = GetMessageText(&dbe.pBlob, &dbe.cbBlob);
- if (pszMsg != NULL && _tcsstr(pszMsg, dbv.ptszVal) != NULL)
+ wchar_t *pszMsg = GetMessageText(&dbe.pBlob, &dbe.cbBlob);
+ if (pszMsg != NULL && wcsstr(pszMsg, dbv.ptszVal) != NULL)
ShutdownAndStopWatcher(); /* msg with specified text recvd */
mir_free(dbv.ptszVal); /* does NULL check */
}