diff options
Diffstat (limited to 'plugins/Alarms')
-rw-r--r-- | plugins/Alarms/alarm_win.cpp | 12 | ||||
-rw-r--r-- | plugins/Alarms/alarmlist.cpp | 54 | ||||
-rw-r--r-- | plugins/Alarms/alarms.cpp | 40 | ||||
-rw-r--r-- | plugins/Alarms/alarms_10.vcxproj | 8 | ||||
-rw-r--r-- | plugins/Alarms/common.h | 22 | ||||
-rw-r--r-- | plugins/Alarms/frame.cpp | 26 | ||||
-rw-r--r-- | plugins/Alarms/options.cpp | 16 | ||||
-rw-r--r-- | plugins/Alarms/trigger.cpp | 4 |
8 files changed, 89 insertions, 93 deletions
diff --git a/plugins/Alarms/alarm_win.cpp b/plugins/Alarms/alarm_win.cpp index 597db12fe0..30b4dd31e5 100644 --- a/plugins/Alarms/alarm_win.cpp +++ b/plugins/Alarms/alarm_win.cpp @@ -174,10 +174,10 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar case WMU_FAKEALARM:
{
- SetWindowText(hwndDlg, Translate("Example Alarm"));
+ SetWindowText(hwndDlg, TranslateT("Example Alarm"));
HWND hw = GetDlgItem(hwndDlg, IDC_TITLE);
- SetWindowText(hw, Translate("Example Alarm"));
- SetDlgItemText(hwndDlg, IDC_ED_DESC, Translate("Some example text. Example, example, example."));
+ SetWindowText(hw, TranslateT("Example Alarm"));
+ SetDlgItemText(hwndDlg, IDC_ED_DESC, TranslateT("Some example text. Example, example, example."));
}
return TRUE;
@@ -287,8 +287,8 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar #define AddItem(x) \
mmi.wID++; \
- mmi.dwTypeData = Translate(x); \
- mmi.cch = ( UINT )strlen(mmi.dwTypeData); \
+ mmi.dwTypeData = TranslateT(x); \
+ mmi.cch = ( UINT )_tcslen(mmi.dwTypeData); \
InsertMenuItem(hMenu, mmi.wID, FALSE, &mmi);
AddItem("5 mins");
@@ -410,7 +410,7 @@ int AlarmWinModulesLoaded(WPARAM wParam, LPARAM lParam) { }
void InitAlarmWin() {
- hUserDll = LoadLibrary("user32.dll");
+ hUserDll = LoadLibrary(_T("user32.dll"));
if (hUserDll) {
MySetLayeredWindowAttributes = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(hUserDll, "SetLayeredWindowAttributes");
//MyAnimateWindow=(BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(hUserDll,"AnimateWindow");
diff --git a/plugins/Alarms/alarmlist.cpp b/plugins/Alarms/alarmlist.cpp index 35ac1fa022..d7b712dee7 100644 --- a/plugins/Alarms/alarmlist.cpp +++ b/plugins/Alarms/alarmlist.cpp @@ -35,10 +35,10 @@ void copy_alarm_data(ALARM *dest, ALARM *src) { dest->trigger_id = src->trigger_id;
free_alarm_data(dest);
- dest->szTitle = _strdup(src->szTitle);
- dest->szDesc = _strdup(src->szDesc);
- dest->szCommand = _strdup(src->szCommand);
- dest->szCommandParams = _strdup(src->szCommandParams);
+ dest->szTitle = mir_tstrdup(src->szTitle);
+ dest->szDesc = mir_tstrdup(src->szDesc);
+ dest->szCommand = mir_tstrdup(src->szCommand);
+ dest->szCommandParams = mir_tstrdup(src->szCommandParams);
}
void GetPluginTime(SYSTEMTIME *t) {
@@ -193,14 +193,14 @@ void LoadAlarms() { sprintf(buff, "Title%d", i);
if (!DBGetContactSetting(0, MODULE, buff, &dbv)) {
- if (dbv.pszVal && strlen(dbv.pszVal))
- alarm.szTitle = _strdup(dbv.pszVal);
+ if (dbv.ptszVal && _tcslen(dbv.ptszVal))
+ alarm.szTitle = mir_tstrdup(dbv.ptszVal);
DBFreeVariant(&dbv);
}
sprintf(buff, "Desc%d", i);
if (!DBGetContactSetting(0, MODULE, buff, &dbv)) {
- if (dbv.pszVal && strlen(dbv.pszVal))
- alarm.szDesc = _strdup(dbv.pszVal);
+ if (dbv.ptszVal && _tcslen(dbv.ptszVal))
+ alarm.szDesc = mir_tstrdup(dbv.ptszVal);
DBFreeVariant(&dbv);
}
sprintf(buff, "Occ%d", i);
@@ -252,13 +252,13 @@ void LoadAlarms() { if (alarm.action & AAF_COMMAND) {
sprintf(buff, "ActionCommand%d", i);
if (!DBGetContactSetting(0, MODULE, buff, &dbv)) {
- if (dbv.pszVal && strlen(dbv.pszVal))
- alarm.szCommand = _strdup(dbv.pszVal);
+ if (dbv.ptszVal && _tcslen(dbv.ptszVal))
+ alarm.szCommand = mir_tstrdup(dbv.ptszVal);
DBFreeVariant(&dbv);
sprintf(buff, "ActionParams%d", i);
if (!DBGetContactSetting(0, MODULE, buff, &dbv)) {
- if (dbv.pszVal && strlen(dbv.pszVal))
- alarm.szCommandParams = _strdup(dbv.pszVal);
+ if (dbv.ptszVal && _tcslen(dbv.ptszVal))
+ alarm.szCommandParams = mir_tstrdup(dbv.ptszVal);
DBFreeVariant(&dbv);
}
}
@@ -308,9 +308,9 @@ void SaveAlarms() { ALARM *i;
for(alarms.reset(); i = alarms.current(); alarms.next(), index++) {
sprintf(buff, "Title%d", index);
- DBWriteContactSettingString(0, MODULE, buff, i->szTitle);
+ DBWriteContactSettingTString(0, MODULE, buff, i->szTitle);
sprintf(buff, "Desc%d", index);
- DBWriteContactSettingString(0, MODULE, buff, i->szDesc);
+ DBWriteContactSettingTString(0, MODULE, buff, i->szDesc);
sprintf(buff, "Occ%d", index);
DBWriteContactSettingWord(0, MODULE, buff, i->occurrence);
@@ -345,12 +345,12 @@ void SaveAlarms() { sprintf(buff, "ActionFlags%d", index);
DBWriteContactSettingDword(0, MODULE, buff, i->action);
if (i->action & AAF_COMMAND) {
- if (strlen(i->szCommand)) {
+ if (_tcslen(i->szCommand)) {
sprintf(buff, "ActionCommand%d", index);
- DBWriteContactSettingString(0, MODULE, buff, i->szCommand);
- if (strlen(i->szCommandParams)) {
+ DBWriteContactSettingTString(0, MODULE, buff, i->szCommand);
+ if (_tcslen(i->szCommandParams)) {
sprintf(buff, "ActionParams%d", index);
- DBWriteContactSettingString(0, MODULE, buff, i->szCommandParams);
+ DBWriteContactSettingTString(0, MODULE, buff, i->szCommandParams);
}
}
}
@@ -536,14 +536,14 @@ void ShowPopup(ALARM *alarm) { memset(data, 0, sizeof(ALARM));
copy_alarm_data(data, alarm);
- POPUPDATAEX ppd;
+ POPUPDATAT ppd;
ZeroMemory(&ppd, sizeof(ppd));
ppd.lchContact = 0;
ppd.lchIcon = hIconMenuSet;
- lstrcpy(ppd.lpzContactName, data->szTitle);
- lstrcpy(ppd.lpzText, data->szDesc);
+ lstrcpy(ppd.lptzContactName, data->szTitle);
+ lstrcpy(ppd.lptzText, data->szDesc);
ppd.colorBack = 0;
ppd.colorText = 0;
ppd.PluginWindowProc = (WNDPROC)PopupAlarmDlgProc;
@@ -622,8 +622,8 @@ void DoAlarm(ALARM *alarm) { cle.cbSize = sizeof(cle);
cle.hContact = 0;
cle.hIcon = hIconSystray;
- cle.pszTooltip = alarm->szTitle;
- cle.flags = CLEF_ONLYAFEW;
+ cle.ptszTooltip = alarm->szTitle;
+ cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
}
@@ -706,10 +706,10 @@ INT_PTR AddAlarmService(WPARAM wParam, LPARAM lParam) alarm.occurrence = alarm_info->occurrence;
alarm.snoozer = alarm_info->snoozer;
alarm.sound_num = alarm_info->sound_num;
- alarm.szCommand = _strdup(alarm_info->szCommand);
- alarm.szCommandParams = _strdup(alarm_info->szCommandParams);
- alarm.szDesc = _strdup(alarm_info->szDesc);
- alarm.szTitle = _strdup(alarm_info->szTitle);
+ alarm.szCommand = mir_tstrdup(alarm_info->szCommand);
+ alarm.szCommandParams = mir_tstrdup(alarm_info->szCommandParams);
+ alarm.szDesc = mir_tstrdup(alarm_info->szDesc);
+ alarm.szTitle = mir_tstrdup(alarm_info->szTitle);
alarm.time = alarm_info->time;
append_to_list(&alarm);
diff --git a/plugins/Alarms/alarms.cpp b/plugins/Alarms/alarms.cpp index 3c0a198716..4c5f4179a6 100644 --- a/plugins/Alarms/alarms.cpp +++ b/plugins/Alarms/alarms.cpp @@ -12,13 +12,13 @@ There is no warranty. struct MM_INTERFACE mmi;
-#define SERVICENAME "mp"
-#define COMMANDPREFIX "/" SERVICENAME
+#define SERVICENAME _T("mp")
+#define COMMANDPREFIX _T("/") SERVICENAME
#define WMP_PAUSE 32808
#define WMP_NEXT 0x497B
-char szGamePrefix[] = COMMANDPREFIX;
+TCHAR szGamePrefix[] = COMMANDPREFIX;
HINSTANCE hInst;
PLUGINLINK *pluginLink;
@@ -83,19 +83,19 @@ static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM return DefWindowProc(hWnd, message, wParam, lParam);
}
-void ShowPopup(HANDLE hContact, const char *msg) {
+void ShowPopup(HANDLE hContact, const TCHAR *msg) {
if (ServiceExists(MS_POPUP_ADDPOPUP)) {
- POPUPDATAEX ppd;
- char *lpzContactName;
+ POPUPDATAT ppd;
+ TCHAR *lpzContactName;
ZeroMemory(&ppd, sizeof(ppd)); //This is always a good thing to do.
ppd.lchContact = hContact; //Be sure to use a GOOD handle, since this will not be checked.
ppd.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
- lpzContactName = (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0);
+ lpzContactName = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
- lstrcpy(ppd.lpzContactName, lpzContactName);
- lstrcpy(ppd.lpzText, msg);
+ lstrcpy(ppd.lptzContactName, lpzContactName);
+ lstrcpy(ppd.lptzText, msg);
ppd.colorBack = GetSysColor(COLOR_BTNFACE);;
ppd.colorText = RGB(0,0,0);
ppd.PluginWindowProc = (WNDPROC)PopupDlgProc;
@@ -122,26 +122,26 @@ static int PluginMessageReceived(WPARAM wParam,LPARAM lParam) {
CCSDATA *pccsd = (CCSDATA *)lParam;
PROTORECVEVENT *ppre = ( PROTORECVEVENT * )pccsd->lParam;
- char *savedMsg;
+ TCHAR *savedMsg;
HWND hWnd;
- char response[256];
+ TCHAR response[256];
- char msg[1024], buff[1024];
+ TCHAR msg[1024], buff[1024];
- if (strncmp(ppre->szMessage, szGamePrefix, strlen(szGamePrefix)))
+ if (_tcsncmp(ppre->tszMessage, szGamePrefix, _tcslen(szGamePrefix)))
return CallService( MS_PROTO_CHAINRECV, wParam, lParam );
- strcpy(msg, ppre->szMessage + strlen(szGamePrefix));
+ _tcscpy(msg, ppre->tszMessage + _tcslen(szGamePrefix));
- savedMsg = ppre->szMessage;
+ savedMsg = ppre->tszMessage;
- if (!strcmp(msg, " ffw")) {
- sprintf(buff, "Fast forward!");
+ if (!_tcscmp(msg, _T(" ffw"))) {
+ mir_sntprintf(buff, SIZEOF(buff), _T("%s"), _T("Fast forward!"));
- hWnd = FindWindow(0, "Windows Media Player");
+ hWnd = FindWindow(0, _T("Windows Media Player"));
PostMessage(hWnd, WM_COMMAND, WMP_NEXT, 0);
} else {
- sprintf(buff, "Unknown command issued: \"%s\"", msg);
+ mir_sntprintf(buff, SIZEOF(buff), _T("Unknown command issued: \"%s\""), msg);
}
/*
@@ -152,7 +152,7 @@ static int PluginMessageReceived(WPARAM wParam,LPARAM lParam) ShowPopup(pccsd->hContact, buff);
- strcpy(response, buff);
+ _tcscpy(response, buff);
PluginSendMessage((WPARAM)pccsd->hContact, (LPARAM)response);
return 0;
diff --git a/plugins/Alarms/alarms_10.vcxproj b/plugins/Alarms/alarms_10.vcxproj index 62e68f99bd..b9617370ac 100644 --- a/plugins/Alarms/alarms_10.vcxproj +++ b/plugins/Alarms/alarms_10.vcxproj @@ -25,20 +25,20 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
diff --git a/plugins/Alarms/common.h b/plugins/Alarms/common.h index d675ab1bf1..b86cd036c0 100644 --- a/plugins/Alarms/common.h +++ b/plugins/Alarms/common.h @@ -14,9 +14,6 @@ #include <stdlib.h>
#include <commctrl.h>
-#include "resource.h"
-#include "version.h"
-
#include <newpluginapi.h>
#include <m_system.h>
#include <m_database.h>
@@ -29,23 +26,22 @@ #include <m_popup.h>
#include <m_utils.h>
#include <m_idle.h>
-
#include <m_clist.h>
#include <m_clui.h>
#include <m_clc.h>
-
#include <m_cluiframes.h>
#include <m_genmenu.h>
+#include <m_fontservice.h>
+#include <m_icolib.h>
+#include <win2k.h>
#include <m_toptoolbar.h>
#include <m_trigger.h>
-
-#include <m_fontservice.h>
#include <m_updater.h>
-
#include <m_alarms.h>
-#include <m_icolib.h>
+#include "resource.h"
+#include "version.h"
#define MODULE "Alarm"
@@ -56,14 +52,14 @@ extern HANDLE hTopToolbarButton; typedef struct ALARM_tag {
unsigned short id;
- char *szTitle;
- char *szDesc;
+ TCHAR *szTitle;
+ TCHAR *szDesc;
Occurrence occurrence;
BOOL snoozer;
SYSTEMTIME time;
unsigned short action;
- char *szCommand;
- char *szCommandParams;
+ TCHAR *szCommand;
+ TCHAR *szCommandParams;
BYTE sound_num;
int flags;
DWORD trigger_id;
diff --git a/plugins/Alarms/frame.cpp b/plugins/Alarms/frame.cpp index d51e021d4d..1e39c38c32 100644 --- a/plugins/Alarms/frame.cpp +++ b/plugins/Alarms/frame.cpp @@ -91,7 +91,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_CREATE:
{
- hwnd_list = CreateWindow("LISTBOX", "",
+ hwnd_list = CreateWindow(_T("LISTBOX"), _T(""),
(WS_VISIBLE | WS_CHILD | LBS_NOINTEGRALHEIGHT | LBS_STANDARD | LBS_NOTIFY | LBS_OWNERDRAWFIXED) & ~LBS_SORT
& ~WS_BORDER, 0, 0, 0, 0, hwnd, NULL, hInst,0);
}
@@ -134,25 +134,25 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar GetTextExtentPoint32(dis->hDC,alarm.szTitle,lstrlen(alarm.szTitle),&textSize);
- char buff[100];
+ TCHAR buff[100];
if (min >= 60) {
- mir_snprintf(buff, 100, Translate("%dh %dm"), min / 60, min % 60);
+ mir_sntprintf(buff, 100, TranslateT("%dh %dm"), min / 60, min % 60);
} else {
- mir_snprintf(buff, 100, Translate("%dm"), min);
+ mir_sntprintf(buff, 100, TranslateT("%dm"), min);
}
GetTextExtentPoint32(dis->hDC,buff,lstrlen(buff),&timeSize);
if (textSize.cx > (dis->rcItem.right - dis->rcItem.left) - (GetSystemMetrics(SM_CXSMICON) + 4) - timeSize.cx - 2 - 4) {
// need elipsis
- char titlebuff[512];
+ TCHAR titlebuff[512];
int len = lstrlen(alarm.szTitle);
if (len > 511) len = 511;
while(len > 0 && textSize.cx > (dis->rcItem.right - dis->rcItem.left) - (GetSystemMetrics(SM_CXSMICON) + 4) - timeSize.cx - 2 - 4) {
len--;
- strncpy(titlebuff, alarm.szTitle, len);
+ _tcsncpy(titlebuff, alarm.szTitle, len);
titlebuff[len] = 0;
- strcat(titlebuff, "...");
+ _tcscat(titlebuff, _T("..."));
GetTextExtentPoint32(dis->hDC,titlebuff,lstrlen(titlebuff),&textSize);
}
TextOut(dis->hDC,dis->rcItem.left + 16 + 4,(dis->rcItem.top + dis->rcItem.bottom - textSize.cy)>>1,titlebuff,lstrlen(titlebuff));
@@ -233,7 +233,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar #define CLUIFrameTitleBarClassName "CLUIFrameTitleBar"
int height = height_client_to_frame(itemheight * count, GetWindowLongPtr(GetParent(hwnd), GWL_STYLE), GetWindowLongPtr(GetParent(hwnd), GWL_EXSTYLE));
- HWND titleBarHwnd = FindWindowEx(GetParent(hwnd), 0, CLUIFrameTitleBarClassName, 0);
+ HWND titleBarHwnd = FindWindowEx(GetParent(hwnd), 0, _T(CLUIFrameTitleBarClassName), 0);
if (titleBarHwnd) {
RECT tbr;
GetWindowRect(titleBarHwnd, &tbr);
@@ -520,12 +520,12 @@ int CreateFrame() wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
wndclass.hbrBackground = 0; //(HBRUSH)(COLOR_3DFACE+1);
wndclass.lpszMenuName = NULL;
- wndclass.lpszClassName = "AlarmsFrame";
+ wndclass.lpszClassName = _T("AlarmsFrame");
RegisterClass(&wndclass);
if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- hwnd_plugin = CreateWindow("AlarmsFrame",Translate("Alarms"),
+ hwnd_plugin = CreateWindow(_T("AlarmsFrame"), TranslateT("Alarms"),
WS_CHILD | WS_CLIPCHILDREN,
0,0,10,10, (HWND)CallService(MS_CLUI_GETHWND, 0, 0), NULL,hInst,NULL);
@@ -549,15 +549,15 @@ int CreateFrame() wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
wndclass.hbrBackground = 0; //(HBRUSH)(COLOR_3DFACE+1);
wndclass.lpszMenuName = NULL;
- wndclass.lpszClassName = "AlarmsFrameContainer";
+ wndclass.lpszClassName = _T("AlarmsFrameContainer");
RegisterClass(&wndclass);
- hwnd_frame = CreateWindowEx(WS_EX_TOOLWINDOW, "AlarmsFrameContainer",Translate("Alarms"),
+ hwnd_frame = CreateWindowEx(WS_EX_TOOLWINDOW, _T("AlarmsFrameContainer"), TranslateT("Alarms"),
(WS_POPUPWINDOW | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN) & ~WS_VISIBLE,
0,0,200,100, (HWND)CallService(MS_CLUI_GETHWND, 0, 0), NULL,hInst,NULL);
//0,0,200,100, GetDesktopWindow(), NULL,hInst,NULL);
- hwnd_plugin = CreateWindow("AlarmsFrame",Translate("Alarms"),
+ hwnd_plugin = CreateWindow(_T("AlarmsFrame"), TranslateT("Alarms"),
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,
0,0,10,10, hwnd_frame, NULL,hInst,NULL);
diff --git a/plugins/Alarms/options.cpp b/plugins/Alarms/options.cpp index 654d39032d..96dbf664fd 100644 --- a/plugins/Alarms/options.cpp +++ b/plugins/Alarms/options.cpp @@ -531,24 +531,24 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDOK:
{
- char buff[MAX_PATH];
+ TCHAR buff[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_TITLE, buff, MAX_PATH);
if (add_edit_alarm->szTitle) free(add_edit_alarm->szTitle);
- add_edit_alarm->szTitle = _strdup(buff);
+ add_edit_alarm->szTitle = mir_tstrdup(buff);
GetDlgItemText(hwndDlg, IDC_DESC, buff, MAX_PATH);
if (add_edit_alarm->szDesc) free(add_edit_alarm->szDesc);
- add_edit_alarm->szDesc = _strdup(buff);
+ add_edit_alarm->szDesc = mir_tstrdup(buff);
- if (add_edit_alarm->szTitle == 0 || strlen(add_edit_alarm->szTitle) == 0) {
- MessageBox(hwndDlg, Translate("Please enter a title for this alarm."), Translate("Error"), MB_OK | MB_ICONERROR);
+ if (add_edit_alarm->szTitle == 0 || _tcslen(add_edit_alarm->szTitle) == 0) {
+ MessageBox(hwndDlg, TranslateT("Please enter a title for this alarm."), TranslateT("Error"), MB_OK | MB_ICONERROR);
return TRUE;
}
SendMessage(hwndDlg, WMU_UPDATETIME, 0, 0);
if (!UpdateAlarm(add_edit_alarm->time, add_edit_alarm->occurrence)) {
- MessageBox(hwndDlg, Translate("The alarm time you have selected is in the past."), Translate("Error"), MB_OK | MB_ICONERROR);
+ MessageBox(hwndDlg, TranslateT("The alarm time you have selected is in the past."), TranslateT("Error"), MB_OK | MB_ICONERROR);
return TRUE;
}
@@ -566,10 +566,10 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (add_edit_alarm->action & AAF_COMMAND) {
GetDlgItemText(hwndDlg, IDC_ED_COMMAND, buff, MAX_PATH);
if (add_edit_alarm->szCommand) free(add_edit_alarm->szCommand);
- add_edit_alarm->szCommand = _strdup(buff);
+ add_edit_alarm->szCommand = mir_tstrdup(buff);
GetDlgItemText(hwndDlg, IDC_ED_PARAMS, buff, MAX_PATH);
if (add_edit_alarm->szCommandParams) free(add_edit_alarm->szCommandParams);
- add_edit_alarm->szCommandParams = _strdup(buff);
+ add_edit_alarm->szCommandParams = mir_tstrdup(buff);
}
if (add_edit_alarm->action & AAF_SOUND) {
diff --git a/plugins/Alarms/trigger.cpp b/plugins/Alarms/trigger.cpp index b52ff8f654..532b98920c 100644 --- a/plugins/Alarms/trigger.cpp +++ b/plugins/Alarms/trigger.cpp @@ -48,7 +48,7 @@ static INT_PTR CALLBACK DlgProcTriggerOptions(HWND hwndDlg, UINT msg, WPARAM wPa td.cbSize = sizeof(td);
td.dFlags = DF_TEXT;
- td.szText = i->szDesc;
+ td.tszText = i->szDesc;
//*(SPECIFICTRIGGERINFO **)lParam = &sti;
break;
}
@@ -97,7 +97,7 @@ int LoadTriggerSupport() { treg.pszName = Translate("Alarms");
treg.hInstance = hInst;
treg.pfnDlgProc = DlgProcTriggerOptions;
- treg.pszTemplate = MAKEINTRESOURCE(IDD_OPTTRIGGER);
+ treg.pszTemplate = MAKEINTRESOURCEA(IDD_OPTTRIGGER);
CallService(MS_TRIGGER_REGISTERTRIGGER, 0, (LPARAM)&treg);
}
|