[REACTOS] Fix a number of Get/SetWindowsLong*Ptr* issues and use GWLP_* instead of GWL_* where appropriate.

This commit is contained in:
Timo Kreuzer 2018-02-05 02:42:14 +01:00
parent 173971d947
commit d281d14fd1
25 changed files with 118 additions and 118 deletions

View file

@ -176,7 +176,7 @@ static void SetupControls(HWND hWnd)
SIZE sizeStarfield;
BITMAP bm;
hInstance = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE);
hInstance = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE);
SendDlgItemMessage(hWnd, IDC_SLIDER_NUM_OF_STARS, TBM_SETRANGE, FALSE, MAKELPARAM(MIN_STARS, MAX_STARS));
@ -273,7 +273,7 @@ static BOOL OnCommandAbout(HWND hWnd)
TCHAR szAuthor[256];
TCHAR szLicense[1024];
hInstance = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE);
hInstance = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE);
hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_STARFIELD));

View file

@ -100,7 +100,7 @@ static HBITMAP CreateStarBitmap(HWND hWnd, HDC hDC)
HINSTANCE hInstance;
// Get instance for loading the texture
hInstance = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE);
hInstance = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE);
// Load the texture
hFileBmp = (HBITMAP)

View file

@ -187,7 +187,7 @@ void OnInit(
{
// Store parameters
SetWindowLong(hDlg, GWL_USERDATA, (ULONG)pParam);
SetWindowLongPtr(hDlg, GWLP_USERDATA, (ULONG_PTR)pParam);
// clear the target existence flag
@ -285,7 +285,7 @@ void OnTarget(
//
// get the current image info
//
param = (PCSAVE_PARAM)GetWindowLong(hDlg, GWL_USERDATA);
param = (PCSAVE_PARAM)GetWindowLongPtr(hDlg, GWLP_USERDATA);
if (_stricmp(param->ImageName, buf) == 0) {
@ -461,7 +461,7 @@ DWORD OnOK(
BOOL truncate;
DWORD ret;
param = (PCSAVE_PARAM)GetWindowLong(hDlg, GWL_USERDATA);
param = (PCSAVE_PARAM)GetWindowLongPtr(hDlg, GWLP_USERDATA);
if (!param) {
return ERROR_INVALID_FUNCTION;

View file

@ -41,8 +41,8 @@ static LRESULT CALLBACK ToolTipProc(
switch (uMsg) {
case WM_CREATE:
// Store Font handle
SetWindowLong(hWnd, GWL_USERDATA,
(LONG)((LPCREATESTRUCT)lParam)->lpCreateParams);
SetWindowLongPtr(hWnd, GWLP_USERDATA,
(LONG_PTR)((LPCREATESTRUCT)lParam)->lpCreateParams);
return 0;
case WM_PAINT:
@ -56,7 +56,7 @@ static LRESULT CALLBACK ToolTipProc(
RECT rc;
SelectObject(hDC, (HFONT)GetWindowLong(hWnd, GWL_USERDATA));
SelectObject(hDC, (HFONT)GetWindowLongPtr(hWnd, GWLP_USERDATA));
SetTextColor(hDC, GetSysColor(COLOR_INFOTEXT));
SetBkMode(hDC, TRANSPARENT);
@ -121,7 +121,7 @@ static LRESULT CALLBACK ToolTipProc(
case WM_DESTROY:
// delete font
DeleteObject((HFONT)GetWindowLong(hWnd, GWL_USERDATA));
DeleteObject((HFONT)GetWindowLongPtr(hWnd, GWLP_USERDATA));
return 0;
}

View file

@ -101,7 +101,7 @@ static void OnSize(ChildWnd* pChildWnd, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static int last_split;
ChildWnd* pChildWnd = (ChildWnd*)GetWindowLong(hWnd, GWL_USERDATA);
ChildWnd* pChildWnd = (ChildWnd*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
ASSERT(pChildWnd);
switch(message) {
@ -121,7 +121,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
return 0;
case WM_NCDESTROY:
// SetWindowLong(hWnd, GWL_USERDATA, 0);
// SetWindowLongPtr(hWnd, GWLP_USERDATA, 0);
break;
case WM_SETCURSOR:

View file

@ -95,7 +95,7 @@ LRESULT CALLBACK CBTProc(int code, WPARAM wParam, LPARAM lParam)
ChildWnd* pChildWnd = newchild;
newchild = NULL;
pChildWnd->hWnd = (HWND)wParam;
SetWindowLong(pChildWnd->hWnd, GWL_USERDATA, (LPARAM)pChildWnd);
SetWindowLongPtr(pChildWnd->hWnd, GWLP_USERDATA, (LPARAM)pChildWnd);
}
return CallNextHookEx(hcbthook, code, wParam, lParam);
}

View file

@ -82,7 +82,7 @@ static void OnPaint(HWND hWnd, ChildWnd* pChildWnd)
LRESULT CALLBACK PanelWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
// Pane* pane;
// ChildWnd* pChildWnd = (ChildWnd*)GetWindowLong(hWnd, GWL_USERDATA);
// ChildWnd* pChildWnd = (ChildWnd*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
// ChildWnd* new_child;
// ASSERT(pChildWnd);