diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2013-08-12 22:25:40 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2013-08-12 22:25:40 +0000 |
commit | af89bddd5ba9f68936dbad0a560c82b7ace9da1c (patch) | |
tree | e64ebfc57a6fc7b0052b6cfcaba7f3562ad152cb | |
parent | 858fb2dfc3f198d5c0c861528115411d4d6904d6 (diff) |
- minor x64 fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@5666 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Exchange/src/dlg_handlers.cpp | 39 | ||||
-rw-r--r-- | plugins/Exchange/src/dlg_handlers.h | 6 | ||||
-rw-r--r-- | plugins/Exchange/src/emails.cpp | 8 | ||||
-rw-r--r-- | plugins/Exchange/src/hooked_events.cpp | 10 |
4 files changed, 18 insertions, 45 deletions
diff --git a/plugins/Exchange/src/dlg_handlers.cpp b/plugins/Exchange/src/dlg_handlers.cpp index af160dac05..9a8095eba6 100644 --- a/plugins/Exchange/src/dlg_handlers.cpp +++ b/plugins/Exchange/src/dlg_handlers.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static WNDPROC OldListProc;
-BOOL CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int bInitializing; //true when dialog is being created
@@ -217,27 +217,6 @@ void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOW hdWnds = DeferWindowPos(hdWnds, window, HWND_NOTOPMOST, rChild.left, rChild.top, rChild.right - rChild.left, rChild.bottom - rChild.top, SWP_NOZORDER);
}
-void SavePosition(HWND hWnd)
-{
- RECT rWnd;
- GetWindowRect(hWnd, &rWnd);
- db_set_dw(0, ModuleName, "PosX", rWnd.left);
- db_set_dw(0, ModuleName, "PosY", rWnd.top);
- //DBWriteContactSettingDword(0, ModuleName, "Width", rWnd.right - rWnd.left);
- //DBWriteContactSettingDword(0, ModuleName, "Height", rWnd.bottom - rWnd.top);
-}
-
-void LoadPosition(HWND hWnd)
-{
- int x, y;
- int width = 500, height = 300;
- x = db_get_dw(0, ModuleName, "PosX", 0);
- y = db_get_dw(0, ModuleName, "PosY", 0);
- //width = DBGetContactSettingDword(0, ModuleName, "Width", 500);
- //height = DBGetContactSettingDword(0, ModuleName, "Height", 300);
- SetWindowPos(hWnd, NULL, x, y, width, height, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOSIZE);
-}
-
int CALLBACK ListSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
@@ -264,9 +243,8 @@ int CALLBACK ListSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_LBUTTONDBLCLK:
{
- int i;
int count = ListView_GetItemCount(hWnd);
- for (i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
if (ListView_GetItemState(hWnd, i, LVIS_SELECTED))
{
@@ -283,7 +261,7 @@ int CALLBACK ListSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) return CallWindowProc(OldListProc, hWnd, msg, wParam, lParam);
}
-BOOL CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
@@ -312,10 +290,7 @@ BOOL CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) col.cchTextMax = _tcslen(col.pszText) + 1;
ListView_InsertColumn(hList, 0, &col);
- //LoadPosition(hWnd);
-
return TRUE;
- break;
}
case WM_DESTROY:
@@ -338,7 +313,6 @@ BOOL CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
HWND hList = GetDlgItem(hWnd, IDC_EMAILS_LIST);
ListView_DeleteAllItems(hList);
- int i;
int count = GetWindowLong(hWnd, GWLP_USERDATA);
LVITEM item = {0};
TEmailHeader email = {0};
@@ -352,7 +326,7 @@ BOOL CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) email.szSubject = subject;
item.mask = LVIF_TEXT;
- for (i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
exchangeServer.GetEmailHeader(i, &email);
item.iItem = i;
@@ -442,9 +416,8 @@ BOOL CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case IDC_MARK_READ:
{
HWND hList = GetDlgItem(hWnd, IDC_EMAILS_LIST);
- int i;
int count = ListView_GetItemCount(hList);
- for (i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
if (ListView_GetCheckState(hList, i))
{
@@ -488,7 +461,7 @@ BOOL CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) return 0;
}
-BOOL CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
diff --git a/plugins/Exchange/src/dlg_handlers.h b/plugins/Exchange/src/dlg_handlers.h index 3aa2550604..2ac8498082 100644 --- a/plugins/Exchange/src/dlg_handlers.h +++ b/plugins/Exchange/src/dlg_handlers.h @@ -25,8 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define EXM_UPDATE_EMAILS WM_USER + 101
-BOOL CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
-BOOL CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
-BOOL CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
#endif //M_EXCHANGE_DIALOG_HANDLERS_H
\ No newline at end of file diff --git a/plugins/Exchange/src/emails.cpp b/plugins/Exchange/src/emails.cpp index 96deb1bc26..d737c8494f 100644 --- a/plugins/Exchange/src/emails.cpp +++ b/plugins/Exchange/src/emails.cpp @@ -388,9 +388,9 @@ int ShowPopupMessage(TCHAR *title, TCHAR *message, int cUnreadEmails) popup.colorBack = NULL;
popup.colorText = NULL;
popup.lchIcon = hiMailIcon;
- _tcsncpy(popup.lptzContactName, title,_tcslen(title));
- _tcsncpy(popup.lptzText, message,_tcslen(message));
- popup.PluginWindowProc = (WNDPROC) DlgProcPopup;
+ _tcsncpy(popup.lptzContactName, title, MAX_CONTACTNAME);
+ _tcsncpy(popup.lptzText, message, MAX_SECONDLINE);
+ popup.PluginWindowProc = DlgProcPopup;
popup.PluginData = (int *) cUnreadEmails;
return PUAddPopupT(&popup);
}
@@ -411,7 +411,7 @@ int ShowEmailsWindow(int cUnreadEmails) {
if (!hEmailsDlg)
{
- hEmailsDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EMAILS), NULL, (DLGPROC)DlgProcEmails);
+ hEmailsDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EMAILS), NULL, DlgProcEmails);
}
SetWindowLong(hEmailsDlg, GWLP_USERDATA, cUnreadEmails);
diff --git a/plugins/Exchange/src/hooked_events.cpp b/plugins/Exchange/src/hooked_events.cpp index f3eb3b60bc..549664c2a6 100644 --- a/plugins/Exchange/src/hooked_events.cpp +++ b/plugins/Exchange/src/hooked_events.cpp @@ -63,7 +63,8 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) cl.hIcon = hiMailIcon;
cl.position = 10000000;
cl.pszService = MS_EXCHANGE_CHECKEMAIL;
- cl.pszName = Translate("Check exchange mailbox");
+ cl.flags = CMIF_TCHAR;
+ cl.ptszName = LPGENT("Check exchange mailbox");
Menu_AddMainMenuItem (&cl);
hEmailsDlg = NULL; //CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EMAILS), NULL, DlgProcEmails); //create emails window
@@ -73,7 +74,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) }
//add the exchange options dialog to miranda
-int OnOptionsInitialise(WPARAM wParam, LPARAM lParam)
+int OnOptionsInitialise(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = {0};
@@ -85,13 +86,12 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM lParam) odp.ptszGroup = LPGENT("Plugins");
odp.groupPosition = 910000000;
odp.flags=ODPF_BOLDGROUPS|ODPF_TCHAR;
- odp.pfnDlgProc = (DLGPROC)DlgProcOptions;
- //CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+ odp.pfnDlgProc = DlgProcOptions;
Options_AddPage(wParam, &odp);
return 0;
}
-int OnSystemPreShutdown(WPARAM wParam, LPARAM lParam)
+int OnSystemPreShutdown(WPARAM, LPARAM)
{
if (hEmailsDlg)
{
|