diff options
Diffstat (limited to 'plugins/WebView')
-rw-r--r-- | plugins/WebView/res/webview.rc | 10 | ||||
-rw-r--r-- | plugins/WebView/src/main.cpp | 52 | ||||
-rw-r--r-- | plugins/WebView/src/webview.cpp | 78 | ||||
-rw-r--r-- | plugins/WebView/src/webview.h | 4 | ||||
-rw-r--r-- | plugins/WebView/src/webview_datawnd.cpp | 50 | ||||
-rw-r--r-- | plugins/WebView/src/webview_opts.cpp | 28 | ||||
-rw-r--r-- | plugins/WebView/src/webview_services.cpp | 56 |
7 files changed, 132 insertions, 146 deletions
diff --git a/plugins/WebView/res/webview.rc b/plugins/WebView/res/webview.rc index 1a6d184d01..bc298893b4 100644 --- a/plugins/WebView/res/webview.rc +++ b/plugins/WebView/res/webview.rc @@ -93,8 +93,8 @@ BEGIN ///////////
GROUPBOX "Error Messages",IDC_STATIC,1,137,278,25
CONTROL "Suppress error messages",IDC_SUPPRESS,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,16,149,105,8
- CONTROL "Display using PopUp or OSD plugin",IDC_ERROR_POPUP,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,16,153,105,8
+ CONTROL "Display using Popup or OSD plugin",IDC_ERROR_POPUP,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,140,149,130,8
//////////
GROUPBOX "Expert Options",IDC_ADV_GRP,142,163,137,35,WS_GROUP
@@ -302,7 +302,7 @@ BEGIN LTEXT "seconds",IDC_STATIC,106,15,34,10
//CONTROL "From PopUp Plugin",IDC_PD1,"Button",BS_AUTORADIOBUTTON,
// 18,30,110,8
- CONTROL "From PopUp Plugin",IDC_PD1,"MButtonClass",WS_TABSTOP,
+ CONTROL "From Popup Plugin",IDC_PD1,"MButtonClass",WS_TABSTOP,
18,30,110,8
//CONTROL "Permanent",IDC_PD2,"Button",BS_AUTORADIOBUTTON,18,45,
// 110,8
@@ -331,7 +331,7 @@ BEGIN BS_AUTORADIOBUTTON,18,135,100,8
CONTROL "Open Web Page",IDC_LCLK_WEB_PGE,"Button",
BS_AUTORADIOBUTTON,18,150,100,8
- CONTROL "Dismiss PopUp",IDC_LCLK_DISMISS,"Button",
+ CONTROL "Dismiss Popup",IDC_LCLK_DISMISS,"Button",
BS_AUTORADIOBUTTON,18,165,100,8
@@ -340,7 +340,7 @@ BEGIN BS_AUTORADIOBUTTON,170,135,100,8
CONTROL "Open Web Page",IDC_RCLK_WEB_PGE,"Button",
BS_AUTORADIOBUTTON,170,150,100,8
- CONTROL "Dismiss PopUp",IDC_RCLK_DISMISS,"Button",
+ CONTROL "Dismiss Popup",IDC_RCLK_DISMISS,"Button",
BS_AUTORADIOBUTTON,170,165,100,8
//CONTROL "Use Popup Plugins Notify Popups",IDC_PUALERT,"Button",
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index 5b5a847fbc..5125c6cbb2 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -153,19 +153,17 @@ extern "C" int __declspec(dllexport) Load() mir_getLP(&pluginInfoEx);
mir_getCLI();
- strncpy_s(optionsname, MODULENAME, SIZEOF(optionsname));
- optionsname[0] = toupper(optionsname[0]);
- HookEvent(ME_CLIST_DOUBLECLICKED, Doubleclick);
+ HookEvent(ME_CLIST_DOUBLECLICKED, Doubleclick);
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
- hRichEd = LoadLibraryA("Riched20.dll");
+ hRichEd = LoadLibrary(_T("Riched20.dll"));
/*TIMERS*/
if ((db_get_dw(NULL, MODULENAME, REFRESH_KEY, TIME) != 0)) {
- timerId = SetTimer(NULL, 0, ((db_get_dw(NULL, MODULENAME, REFRESH_KEY, TIME)) * MINUTE), (TIMERPROC) timerfunc);
+ timerId = SetTimer(NULL, 0, ((db_get_dw(NULL, MODULENAME, REFRESH_KEY, TIME)) * MINUTE), timerfunc);
db_set_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0);
- Countdown = SetTimer(NULL, 0, MINUTE, (TIMERPROC) Countdownfunc);
+ Countdown = SetTimer(NULL, 0, MINUTE, Countdownfunc);
}
InitialiseGlobals();
@@ -190,7 +188,7 @@ extern "C" int __declspec(dllexport) Load() InitServices();
//add sound event to options
- SkinAddNewSoundEx("webviewalert", optionsname, Translate("Alert Event"));
+ SkinAddNewSoundExT("webviewalert", _T(MODULENAME), LPGENT("Alert Event"));
//add module to known list
db_set_s(NULL, "KnownModules", "Webview", MODULENAME);
@@ -199,6 +197,7 @@ extern "C" int __declspec(dllexport) Load() db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 1);
CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIF_TCHAR;
if ( db_get_b(NULL, MODULENAME, MENU_OFF, 0)) {
//value is 0 if menu is enabled
db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 0);
@@ -207,13 +206,12 @@ extern "C" int __declspec(dllexport) Load() CreateServiceFunction("DisableWebview", AutoUpdateMCmd);
mi.position = 20200001;
- mi.pszPopupName = optionsname;
+ mi.ptszPopupName = _T(MODULENAME);
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
if (db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0))
- mi.pszName = "Auto Update Disabled";
-
- if (!(db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0)))
- mi.pszName = "Auto Update Enabled";
+ mi.ptszName = LPGENT("Auto Update Disabled");
+ else
+ mi.ptszName = LPGENT("Auto Update Enabled");
mi.pszService = "DisableWebview";
hMenuItem1 = Menu_AddMainMenuItem(&mi);
@@ -226,7 +224,7 @@ extern "C" int __declspec(dllexport) Load() mi.position = 500090002;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
- mi.pszName = "Update All Webview Sites";
+ mi.ptszName = LPGENT("Update All Webview Sites");
mi.pszService = "UpdateAll";
Menu_AddMainMenuItem(&mi);
@@ -238,7 +236,7 @@ extern "C" int __declspec(dllexport) Load() mi.position = 500090099;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MARKALLREAD));
- mi.pszName = "Mark All Webview Sites Read";
+ mi.ptszName = LPGENT("Mark All Webview Sites Read");
mi.pszService = "MarkAllSitesRead";
Menu_AddMainMenuItem(&mi);
@@ -248,7 +246,7 @@ extern "C" int __declspec(dllexport) Load() CreateServiceFunction("OpenCacheFolder", OpenCacheDir);
mi.position = 500090099;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_FOLDER));
- mi.pszName = "Open Cache Folder";
+ mi.ptszName = LPGENT("Open Cache Folder");
mi.pszService = "OpenCacheFolder";
Menu_AddMainMenuItem(&mi);
@@ -258,12 +256,13 @@ extern "C" int __declspec(dllexport) Load() CreateServiceFunction("Countdown", CountdownMenuCommand);
- char countername[100];
- mir_snprintf(countername, SIZEOF(countername), "%d Minutes to Update", db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
- mi.position = 600090099;;
+ mi.flags |= CMIF_KEEPUNTRANSLATED;
+ TCHAR countername[100];
+ mir_sntprintf(countername, SIZEOF(countername), TranslateT("%d Minutes to Update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
+ mi.position = 600090099;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
mi.pszContactOwner = NULL;
- mi.pszName = countername;
+ mi.ptszName = countername;
mi.pszService = "Countdown";
hMenuItemCountdown = Menu_AddMainMenuItem(&mi);
@@ -272,48 +271,49 @@ extern "C" int __declspec(dllexport) Load() /*
* contact menu
*/
+ mi.flags = CMIF_TCHAR;
CreateServiceFunction("Open web page", WebsiteMenuCommand);
mi.position = 100;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_URL));
mi.pszContactOwner = MODULENAME;
mi.pszService = "Open web page";
- mi.pszName = "Open web page";
+ mi.ptszName = LPGENT("Open web page");
Menu_AddContactMenuItem(&mi);
CreateServiceFunction("OpenClose Window", DataWndMenuCommand);
mi.pszService = "OpenClose Window";
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SHOW_HIDE));
- mi.pszName = "Open/Close window";
+ mi.ptszName = LPGENT("Open/Close window");
Menu_AddContactMenuItem(&mi);
mi.position = 2222220;
mi.pszService = "UpdateData";
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATE));
- mi.pszName = "Update Data";
+ mi.ptszName = LPGENT("Update Data");
Menu_AddContactMenuItem(&mi);
CreateServiceFunction("ContactOptions", CntOptionsMenuCommand);
mi.pszService = "ContactOptions";
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_OPTIONS));
- mi.pszName = "Contact Options";
+ mi.ptszName = LPGENT("Contact Options");
Menu_AddContactMenuItem(&mi);
CreateServiceFunction("ContactAlertOpts", CntAlertMenuCommand);
mi.pszService = "ContactAlertOpts";
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ALERT));
- mi.pszName = "Contact Alert Options";
+ mi.ptszName = LPGENT("Contact Alert Options");
Menu_AddContactMenuItem(&mi);
CreateServiceFunction("PingWebsite", PingWebsiteMenuCommand);
mi.pszService = "PingWebsite";
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_PING));
- mi.pszName = "Ping Web Site";
+ mi.ptszName = LPGENT("Ping Web Site");
Menu_AddContactMenuItem(&mi);
CreateServiceFunction("StopDataProcessing", StpPrcssMenuCommand);
mi.pszService = "StopDataProcessing";
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_STOP));
- mi.pszName = "Stop Data Processing";
+ mi.ptszName = LPGENT("Stop Data Processing");
Menu_AddContactMenuItem(&mi);
hWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index 54107f0600..19ac061690 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -43,7 +43,6 @@ HMENU hMenu; int bpStatus;
HANDLE hMenuItem1;
HANDLE hMenuItemCountdown;
-char optionsname[80];
/*****************************************************************************/
void ChangeMenuItem1()
@@ -51,15 +50,14 @@ void ChangeMenuItem1() /*
* Enable or Disable auto updates
*/
-
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_NAME | CMIM_ICON;
+ mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
- if ( !db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0))
- mi.pszName = Translate("Auto Update Enabled");
+ if (!db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0))
+ mi.ptszName = LPGENT("Auto Update Enabled");
else
- mi.pszName = Translate("Auto Update Disabled");
+ mi.ptszName = LPGENT("Auto Update Disabled");
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem1, (LPARAM)&mi);
}
@@ -70,20 +68,19 @@ void ChangeMenuItemCountdown() /*
* countdown
*/
-
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_NAME | CMIM_ICON;
+ mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
- char countername[100];
- sprintf(countername, "%d Minutes to Update", db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
- mi.pszName = countername;
+ TCHAR countername[100];
+ mir_sntprintf(countername,SIZEOF(countername), TranslateT("%d Minutes to Update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
+ mi.ptszName = countername;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemCountdown, (LPARAM)&mi);
}
/*****************************************************************************/
-static int CALLBACK EnumFontsProc(ENUMLOGFONTEX * lpelfe, NEWTEXTMETRICEX * lpntme, int FontType, LPARAM lParam)
+static int CALLBACK EnumFontsProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, int FontType, LPARAM lParam)
{
if (!IsWindow((HWND) lParam))
return FALSE;
@@ -109,7 +106,7 @@ void TxtclrLoop() {
for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
HWND hwndDlg = WindowList_Find(hWindowList, hContact);
- SetDlgItemTextA(hwndDlg, IDC_DATA, "");
+ SetDlgItemText(hwndDlg, IDC_DATA, _T(""));
InvalidateRect(hwndDlg, NULL, 1);
}
}
@@ -119,7 +116,7 @@ void BGclrLoop() {
for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
HWND hwndDlg = (WindowList_Find(hWindowList, hContact));
- SetDlgItemTextA(hwndDlg, IDC_DATA, "");
+ SetDlgItemText(hwndDlg, IDC_DATA, _T(""));
SendMessage(GetDlgItem(hwndDlg, IDC_DATA), EM_SETBKGNDCOLOR, 0, BackgoundClr);
InvalidateRect(hwndDlg, NULL, 1);
}
@@ -192,8 +189,8 @@ int Doubleclick(WPARAM wParam, LPARAM lParam) }
if ( db_get_b(hContact, MODULENAME, DBLE_WIN_KEY, 1)) {
- HWND hwndDlg;
- if (hwndDlg = WindowList_Find(hWindowList, hContact)) {
+ HWND hwndDlg = WindowList_Find(hWindowList, hContact);
+ if (hwndDlg) {
SetForegroundWindow(hwndDlg);
SetFocus(hwndDlg);
}
@@ -236,7 +233,7 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb DWORD underline = 0;
int len = GetWindowTextLength(GetDlgItem(hWindow, IDC_DATA));
- SetDlgItemTextA(hWindow, IDC_DATA, "");
+ SetDlgItemText(hWindow, IDC_DATA, _T(""));
CHARFORMAT2 cfFM;
ZeroMemory(&cfFM, sizeof(cfFM));
@@ -260,8 +257,7 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb }
else lstrcpy(cfFM.szFaceName, Def_font_face);
- HDC hDC;
- hDC = GetDC(hWindow);
+ HDC hDC = GetDC(hWindow);
cfFM.yHeight = (BYTE)MulDiv(abs(lf.lfHeight), 120, GetDeviceCaps(GetDC(hWindow), LOGPIXELSY)) * (db_get_b(NULL, MODULENAME, FONT_SIZE_KEY, 14));
ReleaseDC(hWindow, hDC);
@@ -269,7 +265,7 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb cfFM.bPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
cfFM.crTextColor = rgbText;
cfFM.crBackColor = rgbBack;
- SendMessage(GetDlgItem(hWindow, IDC_DATA), EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) & cfFM);
+ SendDlgItemMessage(hWindow, IDC_DATA, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) & cfFM);
SendDlgItemMessage(hWindow, IDC_DATA, EM_SETSEL, 0, -1);
SendDlgItemMessageA(hWindow, IDC_DATA, EM_REPLACESEL, FALSE, (LPARAM)truncated);
@@ -278,7 +274,7 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb }
/*****************************************************************************/
-void timerfunc(void)
+void CALLBACK timerfunc(HWND, UINT, UINT_PTR, DWORD)
{
db_set_b(NULL, MODULENAME, HAS_CRASHED_KEY, 0);
@@ -290,16 +286,15 @@ void timerfunc(void) }
/*****************************************************************************/
-void Countdownfunc(void)
+void CALLBACK Countdownfunc(HWND, UINT, UINT_PTR, DWORD)
{
DWORD timetemp = db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 100);
- if(timetemp < 0 || timetemp == 0) {
+ if(timetemp <= 0) {
timetemp = db_get_dw(NULL, MODULENAME, REFRESH_KEY, TIME);
db_set_dw(NULL, MODULENAME, COUNTDOWN_KEY, timetemp);
}
- timetemp = timetemp - 1;
- db_set_dw(NULL, MODULENAME, COUNTDOWN_KEY, timetemp);
+ db_set_dw(NULL, MODULENAME, COUNTDOWN_KEY, timetemp-1);
ChangeMenuItemCountdown();
}
@@ -311,23 +306,16 @@ static int OptInitialise(WPARAM wParam, LPARAM lParam) OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
- odp.pszGroup = Translate("Network");
- odp.pszTitle = optionsname;
+ odp.ptszGroup = LPGENT("Network");
+ odp.ptszTitle = _T(MODULENAME);
odp.pfnDlgProc = DlgProcOpt;
- odp.flags = ODPF_BOLDGROUPS;
+ odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
Options_AddPage(wParam, &odp);
// if popup service exists
if ((ServiceExists(MS_POPUP_ADDPOPUP))) {
- ZeroMemory(&odp, sizeof(odp));
- odp.cbSize = sizeof(odp);
- odp.position = 100000000;
- odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
- odp.pszTitle = optionsname;
- odp.pszGroup = Translate("PopUps");
- odp.groupPosition = 910000000;
- odp.flags = ODPF_BOLDGROUPS;
+ odp.ptszGroup = LPGENT("Popups");
odp.pfnDlgProc = DlgPopUpOpts;
Options_AddPage(wParam, &odp);
}
@@ -354,7 +342,7 @@ void FontSettings(void) }
/*****************************************************************************/
-int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+int ModulesLoaded(WPARAM, LPARAM)
{
HookEvent(ME_OPT_INITIALISE, OptInitialise);
@@ -392,7 +380,7 @@ INT_PTR DataWndMenuCommand(WPARAM wParam, LPARAM lParam) HWND hTopmost = db_get_b(hContact, MODULENAME, ON_TOP_KEY, 0) ? HWND_TOPMOST : HWND_NOTOPMOST;
hwndDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_DISPLAY_DATA), NULL, DlgProcDisplayData, (LPARAM) hContact);
- SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) ((HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_STICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)));
+ SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_STICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
if ( db_get_b(NULL, MODULENAME, SAVE_INDIVID_POS_KEY, 0))
SetWindowPos(hwndDlg, hTopmost,
db_get_dw(hContact, MODULENAME, "WVx", 100), // Xposition,
@@ -428,7 +416,7 @@ INT_PTR AutoUpdateMCmd(WPARAM wParam, LPARAM lParam) {
if (db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0))
db_set_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0);
- else if (!(db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0)))
+ else
db_set_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 1);
ChangeMenuItem1();
@@ -436,7 +424,7 @@ INT_PTR AutoUpdateMCmd(WPARAM wParam, LPARAM lParam) }
/*****************************************************************************/
-INT_PTR AddContactMenuCommand(WPARAM wParam, LPARAM lParam)
+INT_PTR AddContactMenuCommand(WPARAM, LPARAM)
{
db_set_s(NULL, "FindAdd", "LastSearched", MODULENAME);
CallService(MS_FINDADD_FINDADD, 0, 0);
@@ -470,7 +458,7 @@ INT_PTR WebsiteMenuCommand(WPARAM wParam, LPARAM lParam) HANDLE hContact = (HANDLE)wParam;
ptrT url( db_get_tsa(hContact, MODULENAME, "URL"));
if (url)
- CallService(MS_UTILS_OPENURL, OUF_TCHAR, (WPARAM)url);
+ CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM)url);
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);
return 0;
@@ -491,7 +479,7 @@ int ContactMenuItemUpdateData(WPARAM wParam, LPARAM lParam) }
/*****************************************************************************/
-INT_PTR CntOptionsMenuCommand(WPARAM wParam, LPARAM lParam)
+INT_PTR CntOptionsMenuCommand(WPARAM wParam, LPARAM)
{
HWND hwndDlg = WindowList_Find(hWindowList, (HANDLE)wParam);
if (hwndDlg) {
@@ -499,14 +487,14 @@ INT_PTR CntOptionsMenuCommand(WPARAM wParam, LPARAM lParam) return 0;
}
- hwndDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONTACT_OPT ), NULL, DlgProcContactOpt, (LPARAM) (HANDLE) wParam);
+ hwndDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONTACT_OPT), NULL, DlgProcContactOpt, (LPARAM) wParam);
ShowWindow(hwndDlg, SW_SHOW);
SetActiveWindow(hwndDlg);
return 0;
}
/*****************************************************************************/
-INT_PTR CntAlertMenuCommand(WPARAM wParam, LPARAM lParam)
+INT_PTR CntAlertMenuCommand(WPARAM wParam, LPARAM)
{
HWND hwndDlg = WindowList_Find(hWindowList, (HANDLE) wParam);
if (hwndDlg) {
@@ -514,7 +502,7 @@ INT_PTR CntAlertMenuCommand(WPARAM wParam, LPARAM lParam) return 0;
}
- hwndDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ALRT_OPT), NULL, DlgProcAlertOpt, (LPARAM) (HANDLE) wParam);
+ hwndDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ALRT_OPT), NULL, DlgProcAlertOpt, (LPARAM) wParam);
ShowWindow(hwndDlg, SW_SHOW);
SetActiveWindow(hwndDlg);
return 0;
diff --git a/plugins/WebView/src/webview.h b/plugins/WebView/src/webview.h index 8fdfbaa806..d74d6de614 100644 --- a/plugins/WebView/src/webview.h +++ b/plugins/WebView/src/webview.h @@ -149,8 +149,8 @@ extern HANDLE hMenuItem1, hMenuItemCountdown; extern char optionsname[80];
//lets get rid of some warnings
-void timerfunc(void);
-void Countdownfunc(void);
+void CALLBACK timerfunc(HWND, UINT, UINT_PTR, DWORD);
+void CALLBACK Countdownfunc(HWND, UINT, UINT_PTR, DWORD);
void SavewinSettings(void);
void ValidatePosition(HWND hwndDlg);
int ModulesLoaded(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index cf7ec325ea..6a8ae4e6d1 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -182,44 +182,44 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA COLORREF txtcolor;
SendDlgItemMessage(hwndDlg, IDC_DATA, EM_SETBKGNDCOLOR, 0, colour);
- SendDlgItemMessage(hwndDlg, IDC_UPDATE_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) ((HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_UPDATE), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)));
- SendMessage(GetDlgItem(hwndDlg, IDC_UPDATE_BUTTON), BUTTONADDTOOLTIP, (WPARAM) Translate("Update Data"), 0);
+ SendDlgItemMessage(hwndDlg, IDC_UPDATE_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_UPDATE), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
+ SendDlgItemMessage(hwndDlg, IDC_UPDATE_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Update Data"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_FIND_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) ((HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_FIND), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)));
- SendMessage(GetDlgItem(hwndDlg, IDC_FIND_BUTTON), BUTTONADDTOOLTIP, (WPARAM) Translate("Find"), 0);
+ SendDlgItemMessage(hwndDlg, IDC_FIND_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_FIND), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
+ SendDlgItemMessage(hwndDlg, IDC_FIND_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Find"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_OPTIONS_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) ((HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_OPTIONS), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)));
- SendMessage(GetDlgItem(hwndDlg, IDC_OPTIONS_BUTTON), BUTTONADDTOOLTIP, (WPARAM) Translate("Contact Options"), 0);
+ SendDlgItemMessage(hwndDlg, IDC_OPTIONS_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_OPTIONS), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
+ SendDlgItemMessage(hwndDlg, IDC_OPTIONS_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Contact Options"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_ALERT_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) ((HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_ALERT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)));
- SendMessage(GetDlgItem(hwndDlg, IDC_ALERT_BUTTON), BUTTONADDTOOLTIP, (WPARAM) Translate("Alert Options"), 0);
+ SendDlgItemMessage(hwndDlg, IDC_ALERT_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_ALERT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
+ SendDlgItemMessage(hwndDlg, IDC_ALERT_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Alert Options"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_STOP, BM_SETIMAGE, IMAGE_ICON, (LPARAM) ((HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_STOP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)));
- SendMessage(GetDlgItem(hwndDlg, IDC_STOP), BUTTONADDTOOLTIP, (WPARAM) Translate("Stop Processing"), 0);
+ SendDlgItemMessage(hwndDlg, IDC_STOP, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_STOP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
+ SendDlgItemMessage(hwndDlg, IDC_STOP, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Stop Processing"), BATF_TCHAR);
- SendMessage(GetDlgItem(hwndDlg, IDC_OPEN_URL), BUTTONADDTOOLTIP, (WPARAM) Translate("Click here to open this URL in a browser window."), 0);
+ SendDlgItemMessage(hwndDlg, IDC_OPEN_URL, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Click here to open this URL in a browser window."), BATF_TCHAR);
if ( !db_get_b(hContact2, MODULENAME, ON_TOP_KEY, 0)) {
- SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) ((HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_UNSTICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)));
- SendMessage(GetDlgItem(hwndDlg, IDC_STICK_BUTTON), BUTTONADDTOOLTIP, (WPARAM) Translate("Stick to the front"), 0);
+ SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_UNSTICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
+ SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Stick to the front"), BATF_TCHAR);
}
- if ( db_get_b(hContact2, MODULENAME, ON_TOP_KEY, 0)) {
- SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) ((HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_STICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)));
- SendMessage(GetDlgItem(hwndDlg, IDC_STICK_BUTTON), BUTTONADDTOOLTIP, (WPARAM) Translate("Disable Stick to the Front"), 0);
+ else {
+ SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_STICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
+ SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Disable Stick to the Front"), BATF_TCHAR);
}
- SendMessage(GetDlgItem(hwndDlg, IDC_DATA), WM_SETFONT, (WPARAM) h_font, 1);
+ SendDlgItemMessage(hwndDlg, IDC_DATA, WM_SETFONT, (WPARAM) h_font, 1);
txtcolor = TextClr;
- SetDlgItemTextA(hwndDlg, IDC_DATA, "");
+ SetDlgItemText(hwndDlg, IDC_DATA, _T(""));
InvalidateRect(hwndDlg, NULL, 1);
SendMessage(GetDlgItem(hwndDlg, IDC_DATA), EM_AUTOURLDETECT, 1, 0);
int mask = (int) SendMessage(GetDlgItem(hwndDlg, IDC_DATA), EM_GETEVENTMASK, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_DATA), EM_SETEVENTMASK, 0, mask | ENM_LINK | ENM_MOUSEEVENTS);
+ SendDlgItemMessage(hwndDlg, IDC_DATA, EM_SETEVENTMASK, 0, mask | ENM_LINK | ENM_MOUSEEVENTS);
SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_UPDATE_BUTTON, BUTTONSETASFLATBTN, 0, 0);
@@ -255,7 +255,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CHARRANGE sel, all = {0, -1};
HMENU hSubMenu = GetSubMenu(hMenu, 0);
- CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0);
+ TranslateMenu(hSubMenu);
SendMessage(((NMHDR *) lParam)->hwndFrom, EM_EXGETSEL, 0, (LPARAM) & sel);
EnableMenuItem(hSubMenu, IDM_COPY, MF_ENABLED);
@@ -368,7 +368,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hTopmost = HWND_TOPMOST;
ptszToolTip = TranslateT("Disable Stick to the front");
}
- SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) ((HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_UNSTICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)));
+ SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_UNSTICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
SendMessage(GetDlgItem(hwndDlg, IDC_STICK_BUTTON), BUTTONADDTOOLTIP, (WPARAM)ptszToolTip, BATF_TCHAR);
SetWindowPos(hwndDlg, hTopmost, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
}
@@ -376,7 +376,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_FIND_BUTTON:
{
- HWND hwndFind = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FIND), hwndDlg, DlgProcFind, (LPARAM) (HANDLE) wParam);
+ HWND hwndFind = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FIND), hwndDlg, DlgProcFind, (LPARAM) wParam);
ShowWindow(hwndFind, SW_SHOW);
EnableWindow(GetDlgItem(hwndDlg, IDC_FIND_BUTTON), 0);
}
@@ -384,7 +384,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_OPTIONS_BUTTON:
if (hContact = FindContactByUrl(hwndDlg)) {
- ContactHwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONTACT_OPT), hwndDlg, DlgProcContactOpt, (LPARAM) (HANDLE) hContact);
+ ContactHwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONTACT_OPT), hwndDlg, DlgProcContactOpt, (LPARAM) hContact);
ShowWindow(ContactHwnd, SW_SHOW);
SetActiveWindow(ContactHwnd);
EnableWindow(GetDlgItem(hwndDlg, IDC_OPTIONS_BUTTON), 0);
@@ -394,7 +394,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_ALERT_BUTTON:
if (hContact = FindContactByUrl(hwndDlg)) {
- HWND hwndAlertOpt = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ALRT_OPT), hwndDlg, DlgProcAlertOpt, (LPARAM) (HANDLE) hContact);
+ HWND hwndAlertOpt = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ALRT_OPT), hwndDlg, DlgProcAlertOpt, (LPARAM) hContact);
ShowWindow(hwndAlertOpt, SW_SHOW);
SetActiveWindow(hwndAlertOpt);
EnableWindow(GetDlgItem(hwndDlg, IDC_ALERT_BUTTON), 0);
@@ -511,7 +511,7 @@ void ValidatePosition(HWND hwndDlg) typedef HMONITOR WINAPI MyMonitorFromPoint(POINT, DWORD);
typedef BOOL WINAPI MyGetMonitorInfo(HMONITOR, LPMONITORINFO);
- HMODULE hUserInstance = GetModuleHandleA("user32");
+ HMODULE hUserInstance = GetModuleHandle(_T("user32"));
RECT r;
SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0);
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index 760e776e68..2c4cfdc053 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -24,16 +24,16 @@ #include "webview.h"
const TCHAR *szTrackerBarDescr[] = {
- _T("No whitespace removal"),
- _T("Minimal level of whitespace removal"),
- _T("Medium level of whitespace removal"),
- _T("Large level of whitespace removal"),
- _T("Remove all whitespace")
+ LPGENT("No whitespace removal"),
+ LPGENT("Minimal level of whitespace removal"),
+ LPGENT("Medium level of whitespace removal"),
+ LPGENT("Large level of whitespace removal"),
+ LPGENT("Remove all whitespace")
};
static char *fontSizes[] = {"8", "10", "14", "16", "18", "20", "24", "28"};
-static TCHAR *AlertTypes[] = { _T("Popup Plugin"), _T("Log To File"), _T("Open Data Display Window"), _T("Use OSD Plugin") };
-static TCHAR *EventTypes[] = { _T("A String Is Present"), _T("The Web Page Changes"), _T("A Specific Part of Web Page Changes") };
+static TCHAR *AlertTypes[] = { LPGENT("Popup Plugin"), LPGENT("Log To File"), LPGENT("Open Data Display Window"), LPGENT("Use OSD Plugin") };
+static TCHAR *EventTypes[] = { LPGENT("A String Is Present"), LPGENT("The Web Page Changes"), LPGENT("A Specific Part of Web Page Changes") };
#define M_FILLSCRIPTCOMBO (WM_USER+16)
@@ -64,7 +64,7 @@ TCHAR* FixButtonText(TCHAR *url, size_t len) int posafter = (stringafter - buttontext) + 1;
strdel(stringafter, 1);
_tcsncpy_s(stringbefore, pos, buttontext, _TRUNCATE);
- mir_sntprintf(newbuttontext, SIZEOF(buttontext), _T("%s%S%s"), stringbefore, "!!", stringafter);
+ mir_sntprintf(newbuttontext, SIZEOF(buttontext), _T("%s!!%s"), stringbefore, stringafter);
posafter = 0;
posbefore = 0;
@@ -180,11 +180,11 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) break;
case IDC_PD1:
- SetDlgItemTextA(hdlg, IDC_DELAY, "0");
+ SetDlgItemText(hdlg, IDC_DELAY, _T("0"));
break;
case IDC_PD2:
// Popup delay = permanent
- SetDlgItemTextA(hdlg, IDC_DELAY, "-1");
+ SetDlgItemText(hdlg, IDC_DELAY, _T("-1"));
break;
case IDC_DELAY:
@@ -217,7 +217,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) TextColour = TextClr;
}
ppd.lchContact = NULL;
- _tcscpy(ppd.lptzContactName, _A2T(MODULENAME));
+ _tcscpy(ppd.lptzContactName, _T(MODULENAME));
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
_tcscpy(ppd.lptzText, TranslateT("This is a preview popup."));
ppd.colorBack = BGColour;
@@ -225,7 +225,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) ppd.PluginWindowProc = NULL;
ppd.iSeconds = _ttol(str3);
// display popups
- CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, 0);
+ PUAddPopupT(&ppd);
}
}
break;
@@ -1305,8 +1305,8 @@ INT_PTR CALLBACK DlgProcOpt(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara {
KillTimer(NULL, timerId);
KillTimer(NULL, Countdown);
- timerId = SetTimer(NULL, 0, ((db_get_dw(NULL, MODULENAME, REFRESH_KEY, 0)) * MINUTE), (TIMERPROC) timerfunc);
- Countdown = SetTimer(NULL, 0, MINUTE, (TIMERPROC) Countdownfunc);
+ timerId = SetTimer(NULL, 0, ((db_get_dw(NULL, MODULENAME, REFRESH_KEY, 0)) * MINUTE), timerfunc);
+ Countdown = SetTimer(NULL, 0, MINUTE, Countdownfunc);
}
if ((db_get_dw(NULL, MODULENAME, REFRESH_KEY, 0) == 0))
{
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 78c4749b71..3c73882553 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -85,12 +85,12 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) TCHAR *cacheend = _tcsrchr(cachepath, '\\');
cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, SIZEOF(cachedirectorypath), _T("%s%S%S"), cachepath, MODULENAME, "cache\\");
+ mir_sntprintf(cachedirectorypath, SIZEOF(cachedirectorypath), _T("%s")_T(MODULENAME)_T("cache\\"), cachepath);
CreateDirectory(cachedirectorypath, NULL);
TCHAR newcachepath[MAX_PATH + 50], renamedcachepath[MAX_PATH + 50];
- mir_sntprintf(newcachepath, SIZEOF(newcachepath), _T("%s%S%S%s%S"), cachepath, MODULENAME, "cache\\", oldName, ".txt");
- mir_sntprintf(renamedcachepath, SIZEOF(newcachepath), _T("%s%S%S%s%S"), cachepath, MODULENAME, "cache\\", nick, ".txt");
+ mir_sntprintf(newcachepath, SIZEOF(newcachepath), _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, oldName);
+ mir_sntprintf(renamedcachepath, SIZEOF(newcachepath), _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, nick);
// file exists?
if ( _taccess(newcachepath, 0) != -1) {
@@ -124,9 +124,9 @@ int SiteDeleted(WPARAM wParam, LPARAM lParam) cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, SIZEOF(cachedirectorypath), _T("%s%S%S"), cachepath, MODULENAME, "cache\\");
+ mir_sntprintf(cachedirectorypath, SIZEOF(cachedirectorypath), _T("%s")_T(MODULENAME)_T("cache\\"), cachepath);
CreateDirectory(cachedirectorypath, NULL);
- mir_sntprintf(newcachepath, SIZEOF(newcachepath), _T("%s%S%S%s%S"), cachepath, MODULENAME, "cache\\", contactName, ".txt");
+ mir_sntprintf(newcachepath, SIZEOF(newcachepath), _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, contactName);
// file exists?
if ( _taccess(newcachepath, 0) != -1) {
FILE *pcachefile = _tfopen(newcachepath, _T("r"));
@@ -140,7 +140,7 @@ int SiteDeleted(WPARAM wParam, LPARAM lParam) }
/*****************************************************************************/
-INT_PTR OpenCacheDir(WPARAM wParam, LPARAM lParam)
+INT_PTR OpenCacheDir(WPARAM, LPARAM)
{
//GET NAME FOR CACHE
TCHAR cachepath[MAX_PATH], cachedirectorypath[MAX_PATH];
@@ -149,7 +149,7 @@ INT_PTR OpenCacheDir(WPARAM wParam, LPARAM lParam) cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, SIZEOF(cachedirectorypath), _T("%s%S%S%s"), cachepath, MODULENAME, "cache\\", cacheend);
+ mir_sntprintf(cachedirectorypath, SIZEOF(cachedirectorypath), _T("%s")_T(MODULENAME)_T("cache\\%s"), cachepath, cacheend);
if( _taccess(cachedirectorypath, 0) != 0)
WErrorPopup("ERROR", TranslateT("Cache folder does not exist."));
@@ -186,7 +186,7 @@ INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM lParam) }
/*****************************************************************************/
-INT_PTR StpPrcssMenuCommand(WPARAM wParam, LPARAM lParam)
+INT_PTR StpPrcssMenuCommand(WPARAM wParam, LPARAM)
{
db_set_b((HANDLE)wParam, MODULENAME, STOP_KEY, 1);
return 0;
@@ -196,28 +196,27 @@ INT_PTR StpPrcssMenuCommand(WPARAM wParam, LPARAM lParam) // GetCaps
// =======================================================
-INT_PTR GetCaps(WPARAM wParam, LPARAM lParam)
+INT_PTR GetCaps(WPARAM wParam, LPARAM)
{
- if (wParam == PFLAGNUM_1)
+ switch(wParam)
+ {
+ case PFLAGNUM_1:
return PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_VISLIST;
-
- if (wParam == PFLAGNUM_2)
- if (!(db_get_b(NULL, MODULENAME, HIDE_STATUS_ICON_KEY, 0)))
- return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND; // add
-
- if (wParam == PFLAG_UNIQUEIDTEXT)
- return (INT_PTR)Translate("Site URL");
-
- if (wParam == PFLAGNUM_3)
+ case PFLAGNUM_2:
+ return db_get_b(NULL, MODULENAME, HIDE_STATUS_ICON_KEY, 0) ? 0 : (PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND);
+ case PFLAGNUM_3:
return 0;
-
- if (wParam == PFLAGNUM_5)
+ case PFLAGNUM_4:
+ return PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON;
+ case PFLAGNUM_5:
return PF2_INVISIBLE|PF2_SHORTAWAY|PF2_LONGAWAY|PF2_LIGHTDND|PF2_HEAVYDND|PF2_FREECHAT|PF2_OUTTOLUNCH|PF2_ONTHEPHONE;
-
- if (wParam == PFLAG_UNIQUEIDSETTING)
+ case PFLAG_UNIQUEIDTEXT:
+ return (INT_PTR)Translate("Site URL");
+ case PFLAG_UNIQUEIDSETTING:
return (INT_PTR)"PreserveName";
-
- return 0;
+ default:
+ return 0;
+ }
}
// =======================================================
@@ -342,8 +341,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) int samename = 0;
// search for existing contact
- HANDLE hContact;
- for (hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
+ for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
// check ID to see if the contact already exist in the database
if (!db_get_ts(hContact, MODULENAME, "URL", &dbv)) {
if (!lstrcmpi(psr->nick, dbv.ptszVal)) {
@@ -369,7 +367,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) if (psr->cbSize != sizeof(PROTOSEARCHRESULT))
return NULL;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) MODULENAME);
/////////write to db
@@ -454,7 +452,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) }
/*****************************************************************************/
-INT_PTR GetInfo(WPARAM wParam, LPARAM lParam)
+INT_PTR GetInfo(WPARAM, LPARAM)
{
mir_forkthread(AckFunc, NULL);
return 1;
|