Changed SetWindowLong to SetWindowLongPtr and removed WNDPROC related casts

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6180 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2011-11-19 15:41:45 +00:00
parent 940a12b76c
commit 0617c9d3e7
10 changed files with 45 additions and 57 deletions

View file

@ -41,7 +41,7 @@ HMODULE hModule;
HWND g_hwndProgressBar;
HWND g_hwndStatic;
static int g_cancelled;
static void *lpWndProcOld;
static WNDPROC lpWndProcOld;
static UINT uMsgCreate;
@ -100,7 +100,7 @@ static LRESULT CALLBACK ParentWndProc(HWND hwnd, UINT message, WPARAM wParam, LP
);
DWORD dwStyle = WS_CHILD | WS_CLIPSIBLINGS;
dwStyle |= GetWindowLong(hwndP, GWL_STYLE) & PBS_SMOOTH;
dwStyle |= GetWindowLongPtr(hwndP, GWL_STYLE) & PBS_SMOOTH;
GetWindowRect(hwndP, &ctlRect);
@ -182,13 +182,7 @@ static LRESULT CALLBACK ParentWndProc(HWND hwnd, UINT message, WPARAM wParam, LP
}
else
{
return CallWindowProc(
(WNDPROC) lpWndProcOld,
hwnd,
message,
wParam,
lParam
);
return CallWindowProc(lpWndProcOld, hwnd, message, wParam, lParam);
}
return 0;
}
@ -346,7 +340,7 @@ __declspec(dllexport) void download (HWND parent,
{
uMsgCreate = RegisterWindowMessage(_T("nsisdl create"));
lpWndProcOld = (void *)SetWindowLong(parent,GWL_WNDPROC,(long)ParentWndProc);
lpWndProcOld = (WNDPROC)SetWindowLongPtr(parent,GWLP_WNDPROC,(LONG_PTR)ParentWndProc);
SendMessage(parent, uMsgCreate, TRUE, (LPARAM) parent);
@ -420,7 +414,7 @@ __declspec(dllexport) void download (HWND parent,
if (parent)
{
SendMessage(parent, uMsgCreate, FALSE, (LPARAM) parent);
SetWindowLong(parent, GWL_WNDPROC, (long)lpWndProcOld);
SetWindowLongPtr(parent, GWLP_WNDPROC, (LONG_PTR)lpWndProcOld);
}
break;
}