diff options
Diffstat (limited to 'plugins/MyDetails')
-rw-r--r-- | plugins/MyDetails/src/frame.cpp | 24 | ||||
-rw-r--r-- | plugins/MyDetails/src/mydetails.cpp | 14 |
2 files changed, 19 insertions, 19 deletions
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;
}
|