From 4adf822c903129add28d67ede452c7814bfdee4e Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sun, 31 Jul 2016 15:48:04 +0000 Subject: FileAsMessage: - Fixed unicode conversion git-svn-id: http://svn.miranda-ng.org/main/trunk@17149 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/FileAsMessage/fileecho_14.vcxproj | 8 +++---- plugins/FileAsMessage/src/dialog.cpp | 16 +++++++------- plugins/FileAsMessage/src/main.cpp | 36 +++++++++++++++---------------- plugins/FileAsMessage/src/optionsdlg.cpp | 8 +------ 4 files changed, 31 insertions(+), 37 deletions(-) (limited to 'plugins/FileAsMessage') diff --git a/plugins/FileAsMessage/fileecho_14.vcxproj b/plugins/FileAsMessage/fileecho_14.vcxproj index 1a77da60cf..fe0e87cac7 100644 --- a/plugins/FileAsMessage/fileecho_14.vcxproj +++ b/plugins/FileAsMessage/fileecho_14.vcxproj @@ -80,7 +80,7 @@ NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true true - Level3 + Level4 Size ..\..\include;%(AdditionalIncludeDirectories) false @@ -109,7 +109,7 @@ NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true true - Level3 + Level4 Size ..\..\include;%(AdditionalIncludeDirectories) false @@ -137,7 +137,7 @@ _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL - Level3 + Level4 EditAndContinue ..\..\include;%(AdditionalIncludeDirectories) false @@ -164,7 +164,7 @@ _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL - Level3 + Level4 ..\..\include;%(AdditionalIncludeDirectories) false Use diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index a9940f2437..87fa0b194f 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -2,8 +2,8 @@ char *szFEMode[] = { - "Recv file", - "Send file" + LPGEN("Recv file"), + LPGEN("Send file") }; char* ltoax(char* s, DWORD value) @@ -62,7 +62,7 @@ char cCmdList[CMD_COUNT] = '.' }; -static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { MCONTACT hContact = PUGetContact(hWnd); HWND hDlg = (HWND)PUGetPluginData(hWnd); @@ -106,11 +106,11 @@ void MakePopupMsg(HWND hDlg, MCONTACT hContact, char *msg) POPUPDATA ppd = { 0 }; ppd.lchContact = hContact; ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SMALLICON)); - mir_strcpy(ppd.lpzContactName, (char*)pcli->pfnGetContactDisplayName(hContact, 0)); + mir_strcpy(ppd.lpzContactName, _T2A(pcli->pfnGetContactDisplayName(hContact, 0))); mir_strcpy(ppd.lpzText, msg); ppd.colorBack = GetSysColor(COLOR_INFOBK); ppd.colorText = GetSysColor(COLOR_INFOTEXT); - ppd.PluginWindowProc = (WNDPROC)PopupDlgProc; + ppd.PluginWindowProc = PopupDlgProc; ppd.PluginData = (void*)hDlg; ppd.iSeconds = -1; PUAddPopup(&ppd); @@ -239,9 +239,9 @@ void FILEECHO::setState(DWORD state) void FILEECHO::updateTitle() { - char newtitle[256], *contactName; + char newtitle[256]; - contactName = (char*)pcli->pfnGetContactDisplayName(hContact, 0); + char *contactName = _T2A(pcli->pfnGetContactDisplayName(hContact, 0)); if (iState == STATE_OPERATE && chunkCount != 0) mir_snprintf(newtitle, "%d%% - %s: %s", chunkSent * 100 / chunkCount, Translate(szFEMode[inSend]), contactName); else @@ -842,7 +842,7 @@ void FILEECHO::perform(char *str) }; }; -int FILEECHO::sendCmd(int id, int cmd, char *szParam, char *szPrefix) +int FILEECHO::sendCmd(int, int cmd, char *szParam, char *szPrefix) { int buflen = (int)mir_strlen(szServicePrefix) + (int)mir_strlen(szParam) + 2; if (szPrefix != NULL) diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index 7a35c0f156..8f9ae9d594 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -41,7 +41,7 @@ int iIconId[5] = { 3, 2, 4, 1, 0 }; // wParam - Section name // lParam - Icon ID // -int OnSkinIconsChanged(WPARAM wParam, LPARAM lParam) +int OnSkinIconsChanged(WPARAM, LPARAM) { for (int indx = 0; indx < _countof(hIcons); indx++) hIcons[indx] = IcoLib_GetIconByHandle(iconList[indx].hIcolib); @@ -62,7 +62,7 @@ int OnSettingChanged(WPARAM hContact, LPARAM lParam) return 0; } -INT_PTR OnRecvFile(WPARAM wParam, LPARAM lParam) +INT_PTR OnRecvFile(WPARAM, LPARAM lParam) { CLISTEVENT *clev = (CLISTEVENT*)lParam; @@ -76,23 +76,23 @@ INT_PTR OnRecvFile(WPARAM wParam, LPARAM lParam) /* else { - if(hwnd != 0) WindowList_Remove(hFileList, hwnd); - FILEECHO *fe = new FILEECHO((HANDLE)clev->hContact); - fe->inSend = FALSE; - hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, (DLGPROC)DialogProc, (LPARAM)fe); - if(hwnd == NULL) - { - delete fe; - return 0; - } - //SendMessage(hwnd, WM_FE_SERVICE, 0, TRUE); - ShowWindow(hwnd, SW_SHOWNORMAL); + if(hwnd != 0) WindowList_Remove(hFileList, hwnd); + FILEECHO *fe = new FILEECHO((HANDLE)clev->hContact); + fe->inSend = FALSE; + hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, DialogProc, (LPARAM)fe); + if(hwnd == NULL) + { + delete fe; + return 0; + } + //SendMessage(hwnd, WM_FE_SERVICE, 0, TRUE); + ShowWindow(hwnd, SW_SHOWNORMAL); } */ return 1; } -INT_PTR OnSendFile(WPARAM wParam, LPARAM lParam) +INT_PTR OnSendFile(WPARAM wParam, LPARAM) { HWND hwnd = WindowList_Find(hFileList, wParam); if (IsWindow(hwnd)) @@ -144,7 +144,7 @@ INT_PTR OnRecvMessage(WPARAM wParam, LPARAM lParam) return 0; } -int OnOptInitialise(WPARAM wParam, LPARAM lParam) +int OnOptInitialise(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; odp.hInstance = hInst; @@ -161,7 +161,7 @@ int OnOptInitialise(WPARAM wParam, LPARAM lParam) // MirandaPluginInfo() // Called by Miranda to get Version // -extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD dwVersion) +extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD) { return &pluginInfo; } @@ -170,7 +170,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD dwVersi // Startup initializing // -static int OnModulesLoaded(WPARAM wparam, LPARAM lparam) +static int OnModulesLoaded(WPARAM, LPARAM) { for (int indx = 0; indx < _countof(hIcons); indx++) hIcons[indx] = IcoLib_GetIconByHandle(iconList[indx].hIcolib); @@ -235,7 +235,7 @@ extern "C" __declspec(dllexport) int Unload(void) // // DllMain() // -int WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID pReserved) +int WINAPI DllMain(HINSTANCE hInstance, DWORD, LPVOID) { hInst = hInstance; return TRUE; diff --git a/plugins/FileAsMessage/src/optionsdlg.cpp b/plugins/FileAsMessage/src/optionsdlg.cpp index d8b34e5e38..519e5287ee 100644 --- a/plugins/FileAsMessage/src/optionsdlg.cpp +++ b/plugins/FileAsMessage/src/optionsdlg.cpp @@ -40,7 +40,6 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l switch (uMsg) { case WM_INITDIALOG: - { TranslateDialogDefault(hwndDlg); for (int indx = 0; indx < _countof(settingId); indx++) @@ -53,9 +52,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l return TRUE; - } case WM_COMMAND: - { if (//MAKEWPARAM(IDC_AUTO, BN_CLICKED) != wParam || MAKEWPARAM(IDC_ALPHANUM, BN_CLICKED) != wParam) { @@ -77,12 +74,11 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l } SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; - } + case WM_DESTROY: return FALSE; case WM_NOTIFY: - { if ((((NMHDR*)lParam)->idFrom == 0) && (((LPNMHDR)lParam)->code == PSN_APPLY)) { int value; @@ -106,7 +102,5 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l break; } - } - return FALSE; } -- cgit v1.2.3