summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-03-12 12:17:43 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-03-12 12:17:43 +0000
commit5aca7788f891521104f8bed712672af236465cc1 (patch)
tree9ea8115598e2d73f563e2503d0544af62f0d782c
parentd8d1baa7d5c286c907d18d278738331debc0aabd (diff)
SetWindowLongPtr() and GetWindowLongPtr() multiple fixes for x64
git-svn-id: http://svn.miranda-ng.org/main/trunk@8571 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Alarms/src/alarm_win.cpp2
-rw-r--r--plugins/Alarms/src/frame.cpp2
-rw-r--r--plugins/Alarms/src/options.cpp2
-rw-r--r--plugins/AutoShutdown/src/frame.cpp4
-rw-r--r--plugins/AutoShutdown/src/shutdownsvc.cpp2
-rw-r--r--plugins/AvatarHistory/src/AvatarDlg.cpp2
-rw-r--r--plugins/AvatarHistory/src/popup.cpp2
-rw-r--r--plugins/BasicHistory/src/Options.cpp2
-rw-r--r--plugins/BuddyPounce/src/dialog.cpp10
-rw-r--r--plugins/ClientChangeNotify/src/ClientChangeNotify.cpp2
-rw-r--r--plugins/Clist_blind/src/init.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp2
-rw-r--r--plugins/Clist_nicer/skineditor/src/main.cpp2
-rw-r--r--plugins/Console/src/Console.cpp2
-rw-r--r--plugins/DbEditorPP/src/addeditsettingsdlg.cpp2
-rw-r--r--plugins/DbEditorPP/src/main_window.cpp2
-rw-r--r--plugins/DbEditorPP/src/moduletree.cpp2
-rw-r--r--plugins/DbEditorPP/src/settinglist.cpp4
-rw-r--r--plugins/Db_autobackups/src/backup.cpp2
-rw-r--r--plugins/Exchange/src/dlg_handlers.cpp6
-rw-r--r--plugins/Exchange/src/emails.cpp2
-rw-r--r--plugins/FileAsMessage/src/dialog.cpp2
-rw-r--r--plugins/FloatingContacts/src/main.cpp2
-rw-r--r--plugins/HTTPServer/src/GuiElements.cpp2
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist_dlg.cpp2
-rw-r--r--plugins/HistoryStats/src/statistic.cpp2
-rw-r--r--plugins/MirOTR/MirOTR/src/options.cpp4
-rwxr-xr-xplugins/Msg_Export/src/FileViewer.cpp2
-rw-r--r--plugins/MyDetails/src/frame.cpp24
-rw-r--r--plugins/MyDetails/src/mydetails.cpp14
-rw-r--r--plugins/NewAwaySysMod/src/GroupCheckbox.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/Notification.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/Properties.h2
-rw-r--r--plugins/NewsAggregator/Src/Authentication.cpp2
-rw-r--r--plugins/NewsAggregator/Src/Options.cpp4
-rw-r--r--plugins/Non-IM Contact/src/contactinfo.cpp12
-rw-r--r--plugins/PasteIt/src/Options.cpp2
-rw-r--r--plugins/PluginUpdater/src/Options.cpp2
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp8
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp2
-rw-r--r--plugins/Quotes/src/QuoteChart.cpp2
-rw-r--r--plugins/Quotes/src/SettingsDlg.cpp2
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp2
-rw-r--r--plugins/TabSRMM/src/controls.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp2
-rw-r--r--plugins/TabSRMM/src/tabctrl.cpp2
-rw-r--r--plugins/TabSRMM/src/taskbar.cpp2
-rw-r--r--plugins/TooltipNotify/src/Tooltip.cpp2
-rw-r--r--plugins/TopToolBar/src/ttbopt.cpp2
-rw-r--r--plugins/Variables/src/help.cpp2
-rw-r--r--plugins/WebView/src/webview_datawnd.cpp4
-rw-r--r--plugins/WebView/src/webview_opts.cpp16
-rw-r--r--plugins/wbOSD/src/options.cpp2
-rw-r--r--plugins/wbOSD/src/wbOSD.cpp4
-rw-r--r--protocols/AimOscar/src/ui.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp2
-rw-r--r--protocols/JabberG/src/jabber_captcha.cpp2
-rw-r--r--protocols/JabberG/src/ui_utils.cpp2
-rw-r--r--protocols/MRA/src/MraSelectEMail.cpp2
-rw-r--r--protocols/MRA/src/Mra_functions.cpp2
-rw-r--r--protocols/VKontakte/src/vk_captcha.cpp2
62 files changed, 104 insertions, 108 deletions
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp
index 3fb2b2de43..9a66894155 100644
--- a/plugins/Alarms/src/alarm_win.cpp
+++ b/plugins/Alarms/src/alarm_win.cpp
@@ -53,7 +53,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
Utils_SaveWindowPosition(hwndDlg, 0, MODULE, "Notify");
}
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG)wd);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)wd);
// options
SendMessage(hwndDlg, WMU_SETOPT, 0, 0);
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp
index 80501b8619..2c40ab5270 100644
--- a/plugins/Alarms/src/frame.cpp
+++ b/plugins/Alarms/src/frame.cpp
@@ -547,7 +547,7 @@ int CreateFrame()
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,
0,0,10,10, hwnd_frame, NULL,hInst,NULL);
- SetWindowLongPtr(hwnd_frame, GWLP_USERDATA, (LONG)hwnd_plugin);
+ SetWindowLongPtr(hwnd_frame, GWLP_USERDATA, (LONG_PTR)hwnd_plugin);
///////////////////////
// create menu item
diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp
index 9d52447fc0..df943c9dc7 100644
--- a/plugins/Alarms/src/options.cpp
+++ b/plugins/Alarms/src/options.cpp
@@ -74,7 +74,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
BOOL edit = (BOOL)wParam;
add_edit_alarm = (ALARM *)lParam;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG)add_edit_alarm);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)add_edit_alarm);
if (edit) {
SetDlgItemText(hwndDlg, IDC_TITLE, add_edit_alarm->szTitle);
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp
index e5626a2418..65fd3c2a45 100644
--- a/plugins/AutoShutdown/src/frame.cpp
+++ b/plugins/AutoShutdown/src/frame.cpp
@@ -122,7 +122,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA
switch(msg) {
case WM_NCCREATE: /* init window data */
dat=(struct CountdownFrameWndData*)mir_calloc(sizeof(*dat));
- SetWindowLongPtr(hwndFrame, GWLP_USERDATA, (LONG)dat);
+ SetWindowLongPtr(hwndFrame, GWLP_USERDATA, (LONG_PTR)dat);
if (dat==NULL) return FALSE; /* creation failed */
dat->fTimeFlags=*(WORD*)((CREATESTRUCT*)lParam)->lpCreateParams;
dat->flags=FWPDF_COUNTDOWNINVALID;
@@ -240,7 +240,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA
if (dat->hFont != NULL) DeleteObject(dat->hFont);
if (dat->hbrBackground != NULL) DeleteObject(dat->hbrBackground);
mir_free(dat);
- SetWindowLongPtr(hwndFrame, GWLP_USERDATA, (LONG)NULL);
+ SetWindowLongPtr(hwndFrame, GWLP_USERDATA, 0);
break;
case WM_SIZE:
{
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp
index f9fe70fb56..54de8c2c54 100644
--- a/plugins/AutoShutdown/src/shutdownsvc.cpp
+++ b/plugins/AutoShutdown/src/shutdownsvc.cpp
@@ -319,7 +319,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
}
else hBoldFont=NULL;
SendDlgItemMessage(hwndDlg,IDC_TEXT_HEADER,WM_SETFONT,(WPARAM)hBoldFont,FALSE);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TEXT_HEADER), GWLP_USERDATA, (LONG)hBoldFont);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TEXT_HEADER), GWLP_USERDATA, (LONG_PTR)hBoldFont);
}
{
WORD countdown=db_get_w(NULL,"AutoShutdown","ConfirmDlgCountdown",SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT);
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp
index da042e79e4..16613e8fd8 100644
--- a/plugins/AvatarHistory/src/AvatarDlg.cpp
+++ b/plugins/AvatarHistory/src/AvatarDlg.cpp
@@ -143,7 +143,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l
SetWindowText(hwnd,title);
}
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (ULONG_PTR)data->hContact);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data->hContact);
UpdateAvatarPic(hwnd);
CheckDlgButton(hwnd, IDC_LOGUSER, (UINT)db_get_b(data->hContact, MODULE_NAME, "LogToDisk", BST_INDETERMINATE));
CheckDlgButton(hwnd, IDC_POPUPUSER, (UINT)db_get_b(data->hContact, MODULE_NAME, "AvatarPopups", BST_INDETERMINATE));
diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp
index 97e7c594b4..42e2a4c87f 100644
--- a/plugins/AvatarHistory/src/popup.cpp
+++ b/plugins/AvatarHistory/src/popup.cpp
@@ -44,7 +44,7 @@ void InitPopups()
hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, _T("static"), _T(MODULE_NAME) _T("_PopupWindow"),
0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP,
NULL, hInst, NULL);
- SetWindowLong(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc);
+ SetWindowLongPtr(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc);
}
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp
index 25464b0f1f..0d0e56198c 100644
--- a/plugins/BasicHistory/src/Options.cpp
+++ b/plugins/BasicHistory/src/Options.cpp
@@ -1550,7 +1550,7 @@ INT_PTR CALLBACK Options::DlgProcOptsScheduler(HWND hwndDlg, UINT msg, WPARAM wP
case WM_DESTROY:
delete tasks;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, NULL);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
break;
}
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp
index 429ff3f13c..209f5825f8 100644
--- a/plugins/BuddyPounce/src/dialog.cpp
+++ b/plugins/BuddyPounce/src/dialog.cpp
@@ -198,7 +198,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LP
case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
hContact = lParam;
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)lParam);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)lParam);
getDefaultMessage(hwnd, IDC_MESSAGE, hContact);
{
@@ -262,7 +262,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
wi->hContact = lParam;
wi->SendIfMy = 0;
wi->SendWhenThey = 0;
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)wi);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)wi);
getDefaultMessage(hwnd, IDC_MESSAGE, wi->hContact);
{
TCHAR msg[1024];
@@ -397,7 +397,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
wi->hContact = 0;
wi->SendIfMy = 0;
wi->SendWhenThey = 0;
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)wi);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)wi);
getDefaultMessage(hwnd, IDC_MESSAGE, wi->hContact);
mir_sntprintf(msg, SIZEOF(msg), TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
@@ -519,7 +519,7 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
DestroyWindow(hwnd);
spdps->timer = db_get_w(spdps->hContact, modname, "ConfirmTimeout", 0);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (WPARAM)spdps);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)spdps);
{
DBVARIANT dbv;
if (db_get_ts(spdps->hContact, modname, "PounceMsg", &dbv))
@@ -574,7 +574,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
switch(msg) {
case WM_INITDIALOG:
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (WPARAM)lParam);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)lParam);
TranslateDialogDefault(hwnd);
hContact = lParam;
{
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
index b1d54ae4b6..ffe515943c 100644
--- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
+++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
@@ -70,7 +70,7 @@ static VOID NTAPI ShowContactMenu(ULONG_PTR wParam)
{
POINT pt;
HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, _T("static"), _T(MOD_NAME)_T("_MenuWindow"), 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInstance, NULL);
- SetWindowLongPtr(hMenuWnd, GWLP_WNDPROC, (LONG)(WNDPROC)MenuWndProc);
+ SetWindowLongPtr(hMenuWnd, GWLP_WNDPROC, (LONG_PTR)(WNDPROC)MenuWndProc);
HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)wParam, 0);
GetCursorPos(&pt);
SetForegroundWindow(hMenuWnd);
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp
index d6257b5c09..bdce452f73 100644
--- a/plugins/Clist_blind/src/init.cpp
+++ b/plugins/Clist_blind/src/init.cpp
@@ -359,7 +359,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
switch (msg) {
case WM_CREATE:
dat = (ClcData*)mir_calloc( sizeof(ClcData));
- SetWindowLong(hwnd, 0, (LONG) dat);
+ SetWindowLongPtr(hwnd, 0, (LONG_PTR) dat);
dat->hwnd_list = CreateWindow(_T("LISTBOX"), _T(""),
(WS_VISIBLE | WS_CHILD | LBS_NOINTEGRALHEIGHT | LBS_NOTIFY | LBS_WANTKEYBOARDINPUT | WS_VSCROLL),
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp
index 249a67f0ab..32a95990bc 100644
--- a/plugins/Clist_modern/src/modern_aniavatars.cpp
+++ b/plugins/Clist_modern/src/modern_aniavatars.cpp
@@ -1060,7 +1060,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
case WM_DESTROY:
_AniAva_Clear_ANIAVA_WINDOWINFO(dat);
mir_free(dat);
- SetWindowLongPtr(hwnd,GWLP_USERDATA,(LONG_PTR)NULL);
+ SetWindowLongPtr(hwnd,GWLP_USERDATA,0);
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
diff --git a/plugins/Clist_nicer/skineditor/src/main.cpp b/plugins/Clist_nicer/skineditor/src/main.cpp
index bb0038ea2e..9087abbd17 100644
--- a/plugins/Clist_nicer/skineditor/src/main.cpp
+++ b/plugins/Clist_nicer/skineditor/src/main.cpp
@@ -849,7 +849,7 @@ static INT_PTR CALLBACK SkinEdit_ExtBkDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
break;
case WM_NCDESTROY:
free(psd);
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)0);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
break;
}
return FALSE;
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp
index 3d77fe1225..1745c781f5 100644
--- a/plugins/Console/src/Console.cpp
+++ b/plugins/Console/src/Console.cpp
@@ -335,7 +335,7 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARA
dat->Paused = 0;
dat->hList = GetDlgItem(hwndDlg, IDC_LIST);
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG)dat);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
mir_subclassWindow(dat->hList, SubclassProc);
// init buttons
diff --git a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp
index 748e27cd2d..a9915afb74 100644
--- a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp
+++ b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp
@@ -109,7 +109,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case WM_INITDIALOG:
{
char tmp[32];
- SetWindowLongPtr(hwnd,GWLP_USERDATA,(LPARAM)lParam);
+ SetWindowLongPtr(hwnd,GWLP_USERDATA,(LONG_PTR)lParam);
switch (((struct DBsetting*)lParam)->dbv.type)
{
case DBVT_BYTE:
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp
index 0406d5fe11..2442178da5 100644
--- a/plugins/DbEditorPP/src/main_window.cpp
+++ b/plugins/DbEditorPP/src/main_window.cpp
@@ -198,7 +198,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
SetWindowText(hwnd, TranslateT("Database Editor++"));
// setup the splitter
- SetWindowLongPtr(GetDlgItem(hwnd, IDC_SPLITTER), GWLP_USERDATA, (LPARAM)db_get_w(NULL, modname, "Splitter", 300));
+ SetWindowLongPtr(GetDlgItem(hwnd, IDC_SPLITTER), GWLP_USERDATA, (LONG_PTR)db_get_w(NULL, modname, "Splitter", 300));
SendMessage(hwnd, GC_SPLITTERMOVED, 0, 0);
mir_subclassWindow(GetDlgItem(hwnd, IDC_SPLITTER), SplitterSubclassProc);
// module tree
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp
index 0d675682fe..4d5aa57a99 100644
--- a/plugins/DbEditorPP/src/moduletree.cpp
+++ b/plugins/DbEditorPP/src/moduletree.cpp
@@ -617,7 +617,7 @@ void moduleListWM_NOTIFY(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)// hw
lvi.iImage = 6;
ClearListview(hwnd2Settings);
- SetWindowLongPtr(hwnd2Settings, GWLP_USERDATA, (LONG)NULL);
+ SetWindowLongPtr(hwnd2Settings, GWLP_USERDATA, 0);
if (himl2) ListView_SetImageList(hwnd2Settings, himl2, LVSIL_SMALL);
if (mtis->type == CONTACT_ROOT_ITEM && !hContact) {
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp
index 84b9e8a0a3..235b64b129 100644
--- a/plugins/DbEditorPP/src/settinglist.cpp
+++ b/plugins/DbEditorPP/src/settinglist.cpp
@@ -230,7 +230,7 @@ void PopulateSettings(HWND hwnd2Settings, MCONTACT hContact, char* module)
info->hContact = hContact;
info->module = mir_tstrdup(module);
- SetWindowLongPtr(hwnd2Settings,GWLP_USERDATA, (LONG)info);
+ SetWindowLongPtr(hwnd2Settings,GWLP_USERDATA, 0);
// icons
if (himl2)
@@ -659,7 +659,7 @@ void EditLabel(HWND hwnd2List, int item, int subitem)
db_free(&dbv);
- SettingLabelEditSubClass = (WNDPROC)SetWindowLongPtrW(info->hwnd2Edit, GWLP_WNDPROC, (LONG)SettingLabelEditSubClassProc);
+ SettingLabelEditSubClass = (WNDPROC)SetWindowLongPtr(info->hwnd2Edit, GWLP_WNDPROC, (LONG_PTR)SettingLabelEditSubClassProc);
SendMessage(info->hwnd2Edit, WM_USER, 0, (LPARAM)data);
}
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp
index 1e7b9c1c52..394bf7c552 100644
--- a/plugins/Db_autobackups/src/backup.cpp
+++ b/plugins/Db_autobackups/src/backup.cpp
@@ -19,7 +19,7 @@ INT_PTR CALLBACK DlgProcProgress(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_COMMAND:
if ( HIWORD( wParam ) == BN_CLICKED && LOWORD( wParam ) == IDCANCEL ) {
// in the progress dialog, use the user data to indicate that the user has pressed cancel
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)1);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 1);
return TRUE;
}
break;
diff --git a/plugins/Exchange/src/dlg_handlers.cpp b/plugins/Exchange/src/dlg_handlers.cpp
index 631febea78..cc337564d5 100644
--- a/plugins/Exchange/src/dlg_handlers.cpp
+++ b/plugins/Exchange/src/dlg_handlers.cpp
@@ -192,7 +192,7 @@ INT_PTR CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
LVCOLUMN col = {0};
HWND hList = GetDlgItem(hWnd, IDC_EMAILS_LIST);
- OldListProc = (WNDPROC) SetWindowLong(hList, GWLP_WNDPROC, (LONG) ListSubclassProc);
+ OldListProc = (WNDPROC) SetWindowLongPtr(hList, GWLP_WNDPROC, (LONG_PTR) ListSubclassProc);
ListView_SetExtendedListViewStyle(hList, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.cx = 100;
@@ -223,7 +223,7 @@ INT_PTR CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
{
HWND hList = GetDlgItem(hWnd, IDC_EMAILS_LIST);
ListView_DeleteAllItems(hList);
- int count = GetWindowLong(hWnd, GWLP_USERDATA);
+ int count = GetWindowLongPtr(hWnd, GWLP_USERDATA);
LVITEM item = {0};
TEmailHeader email = {0};
email.cbSize = sizeof(TEmailHeader);
@@ -313,7 +313,7 @@ INT_PTR CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
count = exchangeServer.GetUnreadEmailsCount();
if (count > 0)
{
- SetWindowLong(hWnd, GWLP_USERDATA, count);
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, count);
SendMessage(hWnd, EXM_UPDATE_EMAILS, 0, 0);
}
else SendMessage(hWnd, WM_CLOSE, 0, 0);
diff --git a/plugins/Exchange/src/emails.cpp b/plugins/Exchange/src/emails.cpp
index 96b85764a5..5dcd52d1d8 100644
--- a/plugins/Exchange/src/emails.cpp
+++ b/plugins/Exchange/src/emails.cpp
@@ -327,7 +327,7 @@ int ShowEmailsWindow(int cUnreadEmails)
if (!hEmailsDlg)
hEmailsDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EMAILS), NULL, DlgProcEmails);
- SetWindowLong(hEmailsDlg, GWLP_USERDATA, cUnreadEmails);
+ SetWindowLongPtr(hEmailsDlg, GWLP_USERDATA, cUnreadEmails);
if (IsWindowVisible(hEmailsDlg))
SendMessage(hEmailsDlg, EXM_UPDATE_EMAILS, 0, 0);
else
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp
index f668fef130..5b50ef19d7 100644
--- a/plugins/FileAsMessage/src/dialog.cpp
+++ b/plugins/FileAsMessage/src/dialog.cpp
@@ -1016,7 +1016,7 @@ INT_PTR CALLBACK DialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
dat->updateTitle();
hwndStatus = CreateStatusWindow(WS_CHILD|WS_VISIBLE, "", hDlg, IDC_STATUS);
- SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG)dat);
+ SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)dat);
WindowList_Add(hFileList, hDlg, dat->hContact);
SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcons[ICON_MAIN]);
SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcons[ICON_MAIN]);
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp
index ff267bbc3c..3cb5102d27 100644
--- a/plugins/FloatingContacts/src/main.cpp
+++ b/plugins/FloatingContacts/src/main.cpp
@@ -512,7 +512,7 @@ static void CreateThumbWnd(TCHAR *ptszName, MCONTACT hContact, int nX, int nY)
return;
pThumb = thumbList.AddThumb(hwnd, ptszName, hContact);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (long)pThumb);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pThumb);
pThumb->ResizeThumb();
pThumb->SetThumbOpacity(fcOpt.thumbAlpha);
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp
index 12085df132..50ec7a21b0 100644
--- a/plugins/HTTPServer/src/GuiElements.cpp
+++ b/plugins/HTTPServer/src/GuiElements.cpp
@@ -257,7 +257,7 @@ UINT_PTR CALLBACK ShareNewFileDialogHook(
switch (uiMsg) {
case WM_INITDIALOG: {
pstShare = (STFileShareInfo *)((OPENFILENAME *)lParam)->lCustData;
- SetWindowLongPtr(hDlg, GWLP_USERDATA, (LPARAM)pstShare);
+ SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)pstShare);
SetDlgItemInt(hDlg, IDC_MAX_DOWNLOADS, pstShare->nMaxDownloads, true);
SendMessage(GetDlgItem(hDlg, IDC_ALLOWED_IPADDRESS), IPM_SETADDRESS, 0, pstShare->dwAllowedIP);
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
index 067f67043a..711eb41639 100644
--- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
@@ -473,7 +473,7 @@ INT_PTR WINAPI SearchDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam
case WM_INITDIALOG:
{
TranslateDialogDefault(hDlg);
- SetWindowLongPtr(hDlg, GWLP_USERDATA, (LPARAM)lParam);
+ SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)lParam);
SetWindowText(hDlg, TXT_SEARCH);
SendDlgItemMessage(hDlg, IDC_DIR_ALL, BM_SETCHECK, BST_CHECKED, 0);
SendDlgItemMessage(hDlg, IDC_TYPE_ALL, BM_SETCHECK, BST_CHECKED, 0);
diff --git a/plugins/HistoryStats/src/statistic.cpp b/plugins/HistoryStats/src/statistic.cpp
index 134781c888..cbc872fe6d 100644
--- a/plugins/HistoryStats/src/statistic.cpp
+++ b/plugins/HistoryStats/src/statistic.cpp
@@ -1255,7 +1255,7 @@ bool Statistic::createStatistics()
return false;
}
- SetWindowLongPtr(m_hWndProgress, GWLP_USERDATA, reinterpret_cast<LONG>(this));
+ SetWindowLongPtr(m_hWndProgress, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
// Init progress dialog.
utils::centerDialog(m_hWndProgress);
diff --git a/plugins/MirOTR/MirOTR/src/options.cpp b/plugins/MirOTR/MirOTR/src/options.cpp
index b54b0cb723..fd4a4ae2a6 100644
--- a/plugins/MirOTR/MirOTR/src/options.cpp
+++ b/plugins/MirOTR/MirOTR/src/options.cpp
@@ -494,7 +494,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM
{
TranslateDialogDefault( hwndDlg );
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (ULONG_PTR) new ContactPolicyMap());
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) new ContactPolicyMap());
HWND cmb = GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY);
SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_DEFAULT));
@@ -682,7 +682,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w
switch ( msg ) {
case WM_INITDIALOG:
TranslateDialogDefault( hwndDlg );
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (ULONG_PTR) new FPModifyMap());
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) new FPModifyMap());
SendDlgItemMessage(hwndDlg, IDC_LV_FINGER_LIST ,LVM_SETEXTENDEDLISTVIEWSTYLE, 0,LVS_EX_FULLROWSELECT);// | LVS_EX_CHECKBOXES);
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp
index b3f46b2dc6..28f66a1168 100755
--- a/plugins/Msg_Export/src/FileViewer.cpp
+++ b/plugins/Msg_Export/src/FileViewer.cpp
@@ -989,7 +989,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
{
HWND hRichEdit = GetDlgItem(hwndDlg, IDC_RICHEDIT);
mir_subclassWindow(hRichEdit, EditSubclassProc);
- SetWindowLongPtr(hRichEdit, GWLP_USERDATA, (WPARAM)pclDlg);
+ SetWindowLongPtr(hRichEdit, GWLP_USERDATA, (LONG_PTR)pclDlg);
SendMessage(hRichEdit, EM_SETEVENTMASK, 0, ENM_LINK);
SendMessage(hRichEdit, EM_AUTOURLDETECT, TRUE, 0);
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp
index 85bb1fab1f..358dfd9d02 100644
--- a/plugins/MyDetails/src/frame.cpp
+++ b/plugins/MyDetails/src/frame.cpp
@@ -324,7 +324,7 @@ int CreateFrame()
WS_CHILD | WS_VISIBLE,
0,0,10,10, hwnd_container, NULL, hInst, NULL);
- SetWindowLong(hwnd_container, GWLP_USERDATA, (LONG)hwnd_frame);
+ SetWindowLongPtr(hwnd_container, GWLP_USERDATA, (LONG_PTR)hwnd_frame);
SendMessage(hwnd_container, WM_SIZE, 0, 0);
// Create menu item
@@ -372,12 +372,12 @@ LRESULT CALLBACK FrameContainerWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LP
break;
case WM_ERASEBKGND:
- SendMessage((HWND)GetWindowLong(hwnd, GWLP_USERDATA), WM_ERASEBKGND, wParam, lParam);
+ SendMessage((HWND)GetWindowLongPtr(hwnd, GWLP_USERDATA), WM_ERASEBKGND, wParam, lParam);
break;
case WM_SIZE:
{
- HWND child = (HWND)GetWindowLong(hwnd, GWLP_USERDATA);
+ HWND child = (HWND)GetWindowLongPtr(hwnd, GWLP_USERDATA);
RECT r;
GetClientRect(hwnd, &r);
@@ -600,7 +600,7 @@ void CalcRectangles(HWND hwnd)
{
HDC hdc = GetDC(hwnd);
HFONT hOldFont = (HFONT) GetCurrentObject(hdc, OBJ_FONT);
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (hdc == NULL || data == NULL)
return;
@@ -1103,7 +1103,7 @@ void DrawTextWithRect(HDC hdc, const TCHAR *text, const TCHAR *def_text, RECT rc
void Draw(HWND hwnd, HDC hdc_orig)
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
Protocol *proto = protocols->Get(data->protocol_number);
if (proto == NULL) {
@@ -1540,7 +1540,7 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P
LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
Protocol *proto;
switch(msg) {
@@ -1548,7 +1548,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
{
data = new MyDetailsFrameData();
ZeroMemory(data, sizeof(MyDetailsFrameData));
- SetWindowLong(hwnd, GWLP_USERDATA, (LONG) data);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) data);
data->recalc_rectangles = true;
data->get_status_messages = false;
@@ -2122,7 +2122,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
switch (lpnmhdr->code) {
case TTN_GETDISPINFO:
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
proto = protocols->Get(data->protocol_number);
LPNMTTDISPINFO lpttd = (LPNMTTDISPINFO) lpnmhdr;
@@ -2287,7 +2287,7 @@ void RedrawFrame()
void RefreshFrameAndCalcRects()
{
if (hwnd_frame != NULL) {
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWLP_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd_frame, GWLP_USERDATA);
data->recalc_rectangles = true;
PostMessage(hwnd_frame, MWM_REFRESH, 0, 0);
@@ -2346,7 +2346,7 @@ INT_PTR PluginCommand_ShowNextProtocol(WPARAM wParam,LPARAM lParam)
if (hwnd_frame == NULL)
return -1;
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWLP_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd_frame, GWLP_USERDATA);
data->protocol_number ++;
if (data->protocol_number >= protocols->GetSize())
@@ -2368,7 +2368,7 @@ INT_PTR PluginCommand_ShowPreviousProtocol(WPARAM wParam,LPARAM lParam)
if (hwnd_frame == NULL)
return -1;
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWLP_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd_frame, GWLP_USERDATA);
data->protocol_number --;
if (data->protocol_number < 0)
@@ -2405,7 +2405,7 @@ INT_PTR PluginCommand_ShowProtocol(WPARAM wParam,LPARAM lParam)
if (hwnd_frame == NULL)
return -3;
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWLP_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd_frame, GWLP_USERDATA);
data->protocol_number = proto_num;
db_set_w(NULL,"MyDetails","ProtocolNumber",data->protocol_number);
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp
index b6c7464fe3..0f00c8b0b9 100644
--- a/plugins/MyDetails/src/mydetails.cpp
+++ b/plugins/MyDetails/src/mydetails.cpp
@@ -86,7 +86,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam
{
int proto_num = (int)wParam;
- SetWindowLong(hwndDlg, GWLP_USERDATA, proto_num);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, proto_num);
if (proto_num == -1) {
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
@@ -141,7 +141,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam
TCHAR tmp[MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE];
GetDlgItemText(hwndDlg, IDC_NICKNAME, tmp, SIZEOF(tmp));
- int proto_num = (int)GetWindowLong(hwndDlg, GWLP_USERDATA);
+ int proto_num = (int)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (proto_num == -1)
protocols->SetNicks(tmp);
else
@@ -401,7 +401,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w
data->status = (int)wParam;
data->proto_num = (int)lParam;
- SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG) data);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) data);
if (data->proto_num >= 0) {
Protocol *proto = protocols->Get(data->proto_num);
@@ -445,7 +445,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w
TCHAR tmp[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
GetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, tmp, sizeof(tmp));
- SetStatusMessageData *data = (SetStatusMessageData *) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ SetStatusMessageData *data = (SetStatusMessageData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (data->proto_num >= 0)
protocols->Get(data->proto_num)->SetStatusMsg(tmp);
@@ -469,9 +469,9 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w
break;
case WM_DESTROY:
- SetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWLP_WNDPROC,
- GetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWLP_USERDATA));
- free((SetStatusMessageData *) GetWindowLong(hwndDlg, GWLP_USERDATA));
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWLP_WNDPROC,
+ GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWLP_USERDATA));
+ free((SetStatusMessageData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA));
InterlockedExchange(&status_msg_dialog_open, 0);
break;
}
diff --git a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
index 9586122006..aca2c68830 100644
--- a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
+++ b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
@@ -318,7 +318,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
if (dat->hFont)
DeleteObject(dat->hFont);
- SetWindowLongPtr(hWnd, GWLP_USERDATA, NULL);
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, 0);
CallWindowProc(dat->OldWndProc, hWnd, Msg, wParam, lParam);
delete dat;
return 0;
diff --git a/plugins/NewAwaySysMod/src/Notification.cpp b/plugins/NewAwaySysMod/src/Notification.cpp
index 6f04dc0267..5e7b12eedc 100644
--- a/plugins/NewAwaySysMod/src/Notification.cpp
+++ b/plugins/NewAwaySysMod/src/Notification.cpp
@@ -54,7 +54,7 @@ static VOID CALLBACK ShowContactMenu(MCONTACT hContact)
{
POINT pt;
HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, _T("static"), _T(MOD_NAME)_T("_MenuWindow"), 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInstance, NULL);
- SetWindowLongPtr(hMenuWnd, GWLP_WNDPROC, (LONG)(WNDPROC)MenuWndProc);
+ SetWindowLongPtr(hMenuWnd, GWLP_WNDPROC, (LONG_PTR)(WNDPROC)MenuWndProc);
HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, hContact, 0);
GetCursorPos(&pt);
SetForegroundWindow(hMenuWnd);
diff --git a/plugins/NewAwaySysMod/src/Properties.h b/plugins/NewAwaySysMod/src/Properties.h
index 6e839ddd52..8edc9e4c5b 100644
--- a/plugins/NewAwaySysMod/src/Properties.h
+++ b/plugins/NewAwaySysMod/src/Properties.h
@@ -56,7 +56,7 @@ public:
{
_ASSERT(dat == (_CWndUserData*)GetWindowLongPtr(hWnd, GWLP_USERDATA));
if (!dat->MsgTree && !dat->CList) {
- SetWindowLongPtr(hWnd, GWLP_USERDATA, NULL);
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, 0);
delete dat; // TODO: memory leak - this is never executed - fix it
}
}
diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp
index 2ff61ebaef..47918c4706 100644
--- a/plugins/NewsAggregator/Src/Authentication.cpp
+++ b/plugins/NewsAggregator/Src/Authentication.cpp
@@ -57,7 +57,7 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
TranslateDialogDefault(hwndDlg);
ItemInfo &SelItem = *(ItemInfo*)lParam;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG)&SelItem);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)&SelItem);
if (SelItem.hwndList) {
TCHAR str[MAX_PATH];
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp
index 0b9ad7ec4d..a946ba0dac 100644
--- a/plugins/NewsAggregator/Src/Options.cpp
+++ b/plugins/NewsAggregator/Src/Options.cpp
@@ -171,7 +171,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
continue;
nSelItem->hContact = hContact;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG)nSelItem);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)nSelItem);
SetDlgItemText(hwndDlg, IDC_FEEDURL, SelItem.url);
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, SelItem.nick);
SetDlgItemInt(hwndDlg, IDC_CHECKTIME, db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME), TRUE);
@@ -334,7 +334,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP
db_free(&dbv);
}
if (!db_get_ts(hContact, MODULE, "URL", &dbv)) {
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG)lParam);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
SetDlgItemText(hwndDlg, IDC_FEEDURL, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp
index bd986fb1c7..c3fdf597b4 100644
--- a/plugins/Non-IM Contact/src/contactinfo.cpp
+++ b/plugins/Non-IM Contact/src/contactinfo.cpp
@@ -8,7 +8,7 @@ INT_PTR CALLBACK DlgProcContactInfo(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
MCONTACT hContact = (MCONTACT)((PROPSHEETPAGE*)lParam)->lParam;
char name[2048];
TranslateDialogDefault(hwnd);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)(HANDLE)hContact);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)hContact);
if (!db_get_static(hContact, MODNAME, "Name", name)) break;
SetDlgItemTextA(hwnd, IDC_DISPLAY_NAME, name);
@@ -114,7 +114,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
{
MCONTACT hContact = (MCONTACT)((PROPSHEETPAGE*)lParam)->lParam;
TranslateDialogDefault(hwnd);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, hContact);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)hContact);
if (!hContact)
break;
@@ -145,11 +145,11 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
/* icons */
CheckRadioButton(hwnd, 40072, 40080, db_get_w(hContact, MODNAME, "Icon", ID_STATUS_ONLINE));
- SetWindowLongPtr(GetDlgItem(hwnd, CHK_ONLINE), GWLP_USERDATA, (LONG)LoadSkinnedProtoIcon(MODNAME, ID_STATUS_ONLINE));
+ SetWindowLongPtr(GetDlgItem(hwnd, CHK_ONLINE), GWLP_USERDATA, (LONG_PTR)LoadSkinnedProtoIcon(MODNAME, ID_STATUS_ONLINE));
g_PrevBtnWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwnd, CHK_ONLINE), GWLP_WNDPROC, (LPARAM)ButtWndProc);
for (int i = ID_STATUS_ONLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- SetWindowLongPtr(GetDlgItem(hwnd, i), GWLP_USERDATA, (LPARAM)LoadSkinnedProtoIcon(MODNAME, i));
- SetWindowLongPtr(GetDlgItem(hwnd, i), GWLP_WNDPROC, (LPARAM)ButtWndProc);
+ SetWindowLongPtr(GetDlgItem(hwnd, i), GWLP_USERDATA, (LONG_PTR)LoadSkinnedProtoIcon(MODNAME, i));
+ SetWindowLongPtr(GetDlgItem(hwnd, i), GWLP_WNDPROC, (LONG_PTR)ButtWndProc);
}
db_free(&dbv);
/* timer */
@@ -306,7 +306,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = (MCONTACT)((PROPSHEETPAGE*)lParam)->lParam;
TranslateDialogDefault(hwnd);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, hContact);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)hContact);
}
return TRUE;
diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp
index 5a51cdc04b..ddc20d85e1 100644
--- a/plugins/PasteIt/src/Options.cpp
+++ b/plugins/PasteIt/src/Options.cpp
@@ -458,7 +458,7 @@ INT_PTR CALLBACK Options::DlgProcOptsPages(HWND hwndDlg, UINT msg, WPARAM wParam
{
OptsPagesData* optsPagesData = (OptsPagesData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
delete optsPagesData;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, NULL);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
break;
}
}
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp
index 2f25bc86ed..d94f247be9 100644
--- a/plugins/PluginUpdater/src/Options.cpp
+++ b/plugins/PluginUpdater/src/Options.cpp
@@ -51,7 +51,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
SendDlgItemMessage(hwndDlg, IDC_PERIODSPIN, UDM_SETPOS, 0, (LPARAM)opts.Period);
Edit_LimitText(GetDlgItem(hwndDlg, IDC_PERIOD), 2);
- g_pOldProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PERIOD), GWLP_WNDPROC, (LPARAM)MyEditProc);
+ g_pOldProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PERIOD), GWLP_WNDPROC, (LONG_PTR)MyEditProc);
ComboBox_InsertString(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), 0, TranslateT("hours"));
ComboBox_InsertString(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), 1, TranslateT("days"));
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index 29138bf63f..6b45ef1acc 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -1113,17 +1113,13 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
dat->hwndPopup = m_hwnd;
dat->hContact = m_hContact;
if (IsWindowUnicode(hwndEditBox)) {
-
SendMessageW(hwndEditBox, WM_SETFONT, (WPARAM)fonts.text, TRUE);
-
- SetWindowLongPtrW(hwndEditBox, GWLP_USERDATA, (LONG_PTR)dat);
- SetWindowLongPtrW(hwndEditBox, GWLP_WNDPROC, (LONG_PTR)ReplyEditWndProc);
}
else {
SendMessageA(hwndEditBox, WM_SETFONT, (WPARAM)fonts.text, TRUE);
- SetWindowLongPtrA(hwndEditBox, GWLP_USERDATA, (LONG_PTR)dat);
- SetWindowLongPtrA(hwndEditBox, GWLP_WNDPROC, (LONG_PTR)ReplyEditWndProc);
}
+ SetWindowLongPtr(hwndEditBox, GWLP_USERDATA, (LONG_PTR)dat);
+ SetWindowLongPtr(hwndEditBox, GWLP_WNDPROC, (LONG_PTR)ReplyEditWndProc);
SetFocus(hwndEditBox);
break;
}
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index ab849acbc0..e65db46ffd 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -339,7 +339,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
// Read last-sent-to contact from db and set handle as window-userdata
HANDLE hlastsent = (HANDLE)db_get_dw(NULL, MODULE_NAME, "LastSentTo", -1);
- SetWindowLongPtr(hwndMain, GWLP_USERDATA, (LONG)hlastsent);
+ SetWindowLongPtr(hwndMain, GWLP_USERDATA, (LONG_PTR)hlastsent);
// enumerate all contacts and write them to the array
// item data of listbox-strings is the array position
diff --git a/plugins/Quotes/src/QuoteChart.cpp b/plugins/Quotes/src/QuoteChart.cpp
index 17e304f4dc..a60d5d0a7e 100644
--- a/plugins/Quotes/src/QuoteChart.cpp
+++ b/plugins/Quotes/src/QuoteChart.cpp
@@ -129,7 +129,7 @@ namespace
case WM_DESTROY:
{
TChart* pChart = get_chart_ptr(hWnd);
- ::SetWindowLongPtr(hWnd,GWLP_USERDATA,NULL);
+ ::SetWindowLongPtr(hWnd,GWLP_USERDATA,0);
delete pChart;
}
break;
diff --git a/plugins/Quotes/src/SettingsDlg.cpp b/plugins/Quotes/src/SettingsDlg.cpp
index e100401ece..48f190f1c4 100644
--- a/plugins/Quotes/src/SettingsDlg.cpp
+++ b/plugins/Quotes/src/SettingsDlg.cpp
@@ -566,7 +566,7 @@ namespace
update_popup_controls(hWnd);
}
- ::SetWindowLongPtr(hWnd,GWLP_USERDATA,reinterpret_cast<LONG>(pAdvSettings));
+ ::SetWindowLongPtr(hWnd,GWLP_USERDATA,reinterpret_cast<LONG_PTR>(pAdvSettings));
}
return TRUE;
case WM_COMMAND:
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index e4966ec29c..28c92978d5 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -194,7 +194,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
ScreenToClient(hDlg, &p);
DlgDat->ListUCRect.right = p.x;
DlgDat->ListUCRect.bottom = p.y;
- SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG)DlgDat);
+ SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)DlgDat);
//set listview styles
ListView_SetExtendedListViewStyleEx(hList,
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index 5fe283f95b..2e99b8f7bc 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -82,7 +82,7 @@ CMenuBar::CMenuBar(HWND hwndParent, const TContainerData *pContainer)
m_isContactMenu = m_isMainMenu = false;
HookEventParam(ME_LANGPACK_CHANGED, &::resetLP, (LPARAM)this);
- ::SetWindowLongPtr(m_hwndToolbar, GWLP_USERDATA, (UINT_PTR)this);
+ ::SetWindowLongPtr(m_hwndToolbar, GWLP_USERDATA, (LONG_PTR)this);
mir_subclassWindow(m_hwndToolbar, wndProc);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 763620c02c..b2a5898ec1 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -695,7 +695,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
break;
if (PluginConfig.m_SendOnDblEnter) {
- LONG lastEnterTime = GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ LONG_PTR lastEnterTime = GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (lastEnterTime + 2 < time(NULL)) {
lastEnterTime = time(NULL);
SetWindowLongPtr(hwnd, GWLP_USERDATA, lastEnterTime);
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp
index 5db14bfa39..7bff71bdea 100644
--- a/plugins/TabSRMM/src/tabctrl.cpp
+++ b/plugins/TabSRMM/src/tabctrl.cpp
@@ -1074,7 +1074,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
case WM_NCDESTROY:
if (tabdat) {
mir_free(tabdat);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, 0L);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
}
break;
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp
index 0303771b77..cdc0df7366 100644
--- a/plugins/TabSRMM/src/taskbar.cpp
+++ b/plugins/TabSRMM/src/taskbar.cpp
@@ -538,7 +538,7 @@ LRESULT CALLBACK CProxyWindow::stubWndProc(HWND hWnd, UINT msg, WPARAM wParam, L
case WM_NCCREATE:
CREATESTRUCT *cs = reinterpret_cast<CREATESTRUCT *>(lParam);
CProxyWindow *pWnd = reinterpret_cast<CProxyWindow *>(cs->lpCreateParams);
- ::SetWindowLongPtr(hWnd, GWLP_USERDATA, reinterpret_cast<UINT_PTR>(pWnd));
+ ::SetWindowLongPtr(hWnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(pWnd));
return pWnd->wndProc(hWnd, msg, wParam, lParam);
}
return ::DefWindowProc(hWnd, msg, wParam, lParam);
diff --git a/plugins/TooltipNotify/src/Tooltip.cpp b/plugins/TooltipNotify/src/Tooltip.cpp
index ccb92c15c5..fd7610bc59 100644
--- a/plugins/TooltipNotify/src/Tooltip.cpp
+++ b/plugins/TooltipNotify/src/Tooltip.cpp
@@ -22,7 +22,7 @@ CTooltip::CTooltip(CTooltipNotify *pTooltipNotify)
WS_POPUP|WS_BORDER, 100, 100, 50, 50, 0, 0,
g_hInstDLL, NULL);
- SetWindowLongPtr(m_hWnd, GWLP_USERDATA, reinterpret_cast<LONG>(this));
+ SetWindowLongPtr(m_hWnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
}
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp
index e3f38e54fc..01b69b4e54 100644
--- a/plugins/TopToolBar/src/ttbopt.cpp
+++ b/plugins/TopToolBar/src/ttbopt.cpp
@@ -192,7 +192,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
dat = (OrderData*)malloc( sizeof(OrderData));
- SetWindowLongPtr(hTree, GWLP_USERDATA, (LONG)dat);
+ SetWindowLongPtr(hTree, GWLP_USERDATA, (LONG_PTR)dat);
dat->dragging = 0;
SetWindowLongPtr(hTree, GWL_STYLE, GetWindowLongPtr(hTree, GWL_STYLE)|TVS_NOHSCROLL);
diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp
index 9cc79bcf75..fc4bffa54b 100644
--- a/plugins/Variables/src/help.cpp
+++ b/plugins/Variables/src/help.cpp
@@ -1170,7 +1170,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l
mir_free(dat);
dat = NULL;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG)NULL);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
break;
}
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp
index e928b21d6a..084215923a 100644
--- a/plugins/WebView/src/webview_datawnd.cpp
+++ b/plugins/WebView/src/webview_datawnd.cpp
@@ -37,7 +37,7 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetWindowLong(hwndDlg, GWLP_USERDATA, lParam);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
SetWindowText(hwndDlg, TranslateT("Find"));
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM) LoadIcon(hInst, MAKEINTRESOURCE(IDI_FIND)));
return TRUE;
@@ -157,7 +157,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
MCONTACT hContact2 = lParam;
- SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG) hContact2);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) hContact2);
WindowList_Add(hWindowList, hwndDlg, hContact2);
url[0] = '\0';
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp
index d15e771219..f49ca27613 100644
--- a/plugins/WebView/src/webview_opts.cpp
+++ b/plugins/WebView/src/webview_opts.cpp
@@ -287,7 +287,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
TranslateDialogDefault(hwndDlg);
hContact = lParam;
- SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG) hContact);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) hContact);
SetWindowText(hwndDlg, TranslateT("Alert options"));
@@ -509,7 +509,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
break;
case IDC_ENABLE_ALERTS:
- hContact = (MCONTACT)GetWindowLong(hwndDlg, GWLP_USERDATA);
+ hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
EnableWindow(GetDlgItem(hwndDlg, IDC_ADD_DATE_NAME), (IsDlgButtonChecked(hwndDlg, IDC_ENABLE_ALERTS)));
if ( IsDlgButtonChecked(hwndDlg, IDC_ADD_DATE_NAME)) {
@@ -631,7 +631,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case IDC_ALERT_TYPE:
if (HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_EDITCHANGE) {
- hContact = (MCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ hContact = (MCONTACT) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
int alertIndex = SendDlgItemMessage(hwndDlg, IDC_ALERT_TYPE, CB_GETCURSEL, 0, 0);
if (HIWORD(wParam) == CBN_SELCHANGE) {
@@ -678,7 +678,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case IDC_EVENT_TYPE:
if (HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_EDITCHANGE) {
- MCONTACT hContact = (MCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ MCONTACT hContact = (MCONTACT) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
int eventIndex = SendDlgItemMessage(hwndDlg, IDC_EVENT_TYPE, CB_GETCURSEL, 0, 0);
if (HIWORD(wParam) == CBN_SELCHANGE) {
@@ -709,7 +709,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case IDC_ALERT_APPLY:
case IDC_OK2:
{
- hContact = (MCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ hContact = (MCONTACT) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
TCHAR buf[MAX_PATH];
eventIndex = db_get_b(hContact, MODULENAME, EVNT_INDEX_KEY, 0);
@@ -826,7 +826,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
test = 0;
test2 = 0;
- SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG) hContact);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) hContact);
WindowList_Add(hWindowList, hwndDlg, hContact);
SetWindowText(hwndDlg, TranslateT("Contact options"));
@@ -927,7 +927,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_CPY_STRINGS:
{
TCHAR string[128];
- hContact = (MCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ hContact = (MCONTACT) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_START, string, SIZEOF(string));
db_set_ts(hContact, MODULENAME, ALRT_S_STRING_KEY, string);
@@ -1022,7 +1022,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
break;
}
- hContact = (MCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ hContact = (MCONTACT) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_URL, url, SIZEOF(url));
db_set_ts(hContact, MODULENAME, URL_KEY, url);
diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp
index abd3bfd4ff..12b7738a9b 100644
--- a/plugins/wbOSD/src/options.cpp
+++ b/plugins/wbOSD/src/options.cpp
@@ -224,7 +224,7 @@ INT_PTR CALLBACK OptDlgProc(HWND hDlg,UINT msg,WPARAM wparam,LPARAM lparam)
ps=(plgsettings*)malloc(sizeof(plgsettings)*2);
loadDBSettings(&ps[0]);
ps[1]=ps[0];
- SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG)ps);
+ SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ps);
SetWindowLongPtr(hwnd, GWL_STYLE, WS_POPUP | WS_SIZEBOX);
SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED);
diff --git a/plugins/wbOSD/src/wbOSD.cpp b/plugins/wbOSD/src/wbOSD.cpp
index ce379a86d5..da5b031aad 100644
--- a/plugins/wbOSD/src/wbOSD.cpp
+++ b/plugins/wbOSD/src/wbOSD.cpp
@@ -116,7 +116,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
switch (message) {
case WM_CREATE:
logmsg("WindowProcedure::CREATE");
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)&defstr);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&defstr);
return 0;
case WM_DESTROY:
@@ -201,7 +201,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
memcpy(ms, (osdmsg*)wParam, sizeof(osdmsg));
ms->text = mir_tstrdup( ms->text );
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)ms);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)ms);
SetTimer(hwnd, (UINT)ms, (int)ms->timeout, 0);
InvalidateRect(hwnd, 0, TRUE);
SendMessage(hwnd, WM_USER+2, 0, 0);
diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp
index 5e5a4fd7f5..a802460379 100644
--- a/protocols/AimOscar/src/ui.cpp
+++ b/protocols/AimOscar/src/ui.cpp
@@ -202,7 +202,7 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (((LPNMHDR)lParam)->code == PSN_PARAMCHANGED)
{
ppro = (CAimProto*)((PSHNOTIFY*)lParam)->lParam;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, LPARAM(ppro));
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)ppro);
DBVARIANT dbv;
if (!db_get_utf(NULL, ppro->m_szModuleName, AIM_KEY_PR, &dbv))
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 951ca3bbf0..cc2228bf27 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -641,7 +641,7 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
gg->gg_LeaveCriticalSection(&gg->sess_mutex, "gg_img_dlgproc", 59, 1, "sess_mutex", 1);
// Protect dat from releasing
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)0);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
EndDialog(hwndDlg, 0);
}
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index 07490019c1..e797ebc6df 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -762,7 +762,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara
}
if (dat->hEvent) UnhookEvent(dat->hEvent);
SAFE_FREE(&dat->okButtonFormat);
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, NULL);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
SAFE_FREE((void**)&dat);
break;
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp
index 31704b3769..c9a0c50860 100644
--- a/protocols/JabberG/src/jabber_captcha.cpp
+++ b/protocols/JabberG/src/jabber_captcha.cpp
@@ -52,7 +52,7 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (hint == NULL)
hint = TranslateT("Enter the text you see");
SetDlgItemText(hwndDlg, IDC_INSTRUCTION, TranslateTS(hint));
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG)params);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)params);
return TRUE;
}
diff --git a/protocols/JabberG/src/ui_utils.cpp b/protocols/JabberG/src/ui_utils.cpp
index 6847c8be3b..4a5e052d84 100644
--- a/protocols/JabberG/src/ui_utils.cpp
+++ b/protocols/JabberG/src/ui_utils.cpp
@@ -2166,7 +2166,7 @@ void CCtrlBase::Unsubclass()
{
if (m_wndproc) {
SetWindowLongPtr(m_hwnd, GWLP_WNDPROC, (LONG_PTR)m_wndproc);
- SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)0);
+ SetWindowLongPtr(m_hwnd, GWLP_USERDATA, 0);
m_wndproc = 0;
} }
diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp
index bfe205f2e0..645ee14475 100644
--- a/protocols/MRA/src/MraSelectEMail.cpp
+++ b/protocols/MRA/src/MraSelectEMail.cpp
@@ -78,7 +78,7 @@ INT_PTR CALLBACK MraSelectEMailDlgProc(HWND hWndDlg, UINT message, WPARAM wParam
break;
case WM_DESTROY:
- SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)0);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, 0);
mir_free(dat);
EndDialog(hWndDlg, NO_ERROR);
break;
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index 70be23b167..7e08b7f918 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -1179,7 +1179,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w
break;
case WM_DESTROY:
- SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)0);
+ SetWindowLongPtr(hWndDlg, GWLP_USERDATA, 0);
mir_free(dat);
EndDialog(hWndDlg, NO_ERROR);
break;
diff --git a/protocols/VKontakte/src/vk_captcha.cpp b/protocols/VKontakte/src/vk_captcha.cpp
index 040003160c..20981ae51d 100644
--- a/protocols/VKontakte/src/vk_captcha.cpp
+++ b/protocols/VKontakte/src/vk_captcha.cpp
@@ -39,7 +39,7 @@ static INT_PTR CALLBACK CaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
params = (CAPTCHA_FORM_PARAMS*)lParam;
SetDlgItemText(hwndDlg, IDC_INSTRUCTION, TranslateT("Enter the text you see"));
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG)params);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)params);
return TRUE;
}