[REACTOS] Fix a number of Get/SetWindowsLong*Ptr* issues and use GWLP_* instead of...
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 5 Feb 2018 01:42:14 +0000 (02:42 +0100)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 19 Feb 2018 21:36:36 +0000 (22:36 +0100)
25 files changed:
base/applications/games/solitaire/solitaire.cpp
base/applications/games/spider/spider.cpp
base/applications/mspaint/toolbox.cpp
base/applications/network/telnet/src/tnmisc.cpp
base/setup/reactos/drivepage.c
base/setup/reactos/reactos.c
dll/cpl/sysdm/environment.c
dll/cpl/sysdm/general.c
dll/cpl/timedate/dateandtime.c
dll/shellext/netshell/setup.cpp
dll/win32/browseui/shellbrowser.cpp
dll/win32/newdev/wizard.c
dll/win32/shimgvw/shimgvw.c
dll/win32/syssetup/wizard.c
modules/rosapps/applications/screensavers/ssstars/settings.c
modules/rosapps/applications/screensavers/ssstars/ssstars.c
modules/rosapps/lib/vfdlib/vfdguisave.c
modules/rosapps/lib/vfdlib/vfdguitip.c
modules/rosapps/templates/mdi/childwnd.c
modules/rosapps/templates/mdi/framewnd.c
modules/rosapps/templates/mdi/panelwnd.c
modules/rostests/tests/button2/buttontst2.c
modules/rostests/tests/subclass/subclass.c
modules/rostests/win32/user32/kbdlayout/kbdlayout.c
sdk/include/psdk/windowsx.h

index 6eca402..a5b9da4 100644 (file)
@@ -427,7 +427,7 @@ CardImageWndProc(HWND hwnd,
                  LPARAM lParam)
 {
     PCARDBACK pCardBack = (PCARDBACK)GetWindowLongPtr(hwnd,
-                                                      GWL_USERDATA);
+                                                      GWLP_USERDATA);
     static WNDPROC hOldProc = NULL;
 
     if (!hOldProc && pCardBack)
@@ -528,7 +528,7 @@ INT_PTR CALLBACK CardBackDlgProc(HWND hDlg,
                                                                (LONG_PTR)CardImageWndProc);
 
             SetWindowLongPtr(pCardBacks[i].hSelf,
-                             GWL_USERDATA,
+                             GWLP_USERDATA,
                              (LONG_PTR)&pCardBacks[i]);
         }
 
index 519b534..8b5ab8b 100644 (file)
@@ -155,7 +155,7 @@ int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCm
 
 LRESULT CALLBACK CardImageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
-    PCARDBACK pCardBack = (PCARDBACK)GetWindowLongPtr(hwnd, GWL_USERDATA);
+    PCARDBACK pCardBack = (PCARDBACK)GetWindowLongPtr(hwnd, GWLP_USERDATA);
     static WNDPROC hOldProc = NULL;
 
     if (!pCardBack)
@@ -248,7 +248,7 @@ INT_PTR CALLBACK CardBackDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
                                                                    GWLP_WNDPROC,
                                                                    (LONG_PTR)CardImageWndProc);
 
-                SetWindowLongPtr(pCardBacks[i].hSelf, GWL_USERDATA, (LONG_PTR)&pCardBacks[i]);
+                SetWindowLongPtr(pCardBacks[i].hSelf, GWLP_USERDATA, (LONG_PTR)&pCardBacks[i]);
             }
 
             return TRUE;
index 7455917..6bf67b8 100644 (file)
@@ -29,7 +29,7 @@ LRESULT CToolBox::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandl
                    WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_VERT | CCS_NORESIZE | TBSTYLE_TOOLTIPS);
     hImageList = ImageList_Create(16, 16, ILC_COLOR24 | ILC_MASK, 16, 0);
     toolbar.SendMessage(TB_SETIMAGELIST, 0, (LPARAM) hImageList);
-    tempBm = (HBITMAP) LoadImage((HINSTANCE) GetWindowLong(GWL_HINSTANCE), MAKEINTRESOURCE(IDB_TOOLBARICONS), IMAGE_BITMAP, 256, 16, 0);
+    tempBm = (HBITMAP) LoadImage((HINSTANCE)GetWindowLongPtr(GWLP_HINSTANCE), MAKEINTRESOURCE(IDB_TOOLBARICONS), IMAGE_BITMAP, 256, 16, 0);
     ImageList_AddMasked(hImageList, tempBm, 0xff00ff);
     DeleteObject(tempBm);
     toolbar.SendMessage(TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
@@ -42,7 +42,7 @@ LRESULT CToolBox::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandl
         if (i % 2 == 1)
             wrapnow = TBSTATE_WRAP;
 
-        LoadString((HINSTANCE) GetWindowLong(GWL_HINSTANCE), IDS_TOOLTIP1 + i, tooltips[i], 30);
+        LoadString((HINSTANCE)GetWindowLongPtr(GWLP_HINSTANCE), IDS_TOOLTIP1 + i, tooltips[i], 30);
         ZeroMemory(&tbbutton, sizeof(TBBUTTON));
         tbbutton.iString   = (INT_PTR) tooltips[i];
         tbbutton.fsStyle   = TBSTYLE_CHECKGROUP;
index abd3060..6c98739 100644 (file)
@@ -153,8 +153,8 @@ bool SetIcon(HWND hConsoleWindow, HANDLE hIcon, LPARAM *pOldBIcon, LPARAM *pOldS
 #else
        // load the icon from the resource file -crn@ozemail.com.au 16/12/98
        if(!hIcon) {
-               hIcon = LoadIcon ((HANDLE)GetWindowLongPtr(hConsoleWindow,
-                       GWL_HINSTANCE), "TELNETICON");
+               hIcon = LoadIcon((HANDLE)GetWindowLongPtr(hConsoleWindow,
+                       GWLP_HINSTANCE), "TELNETICON");
        }
 #endif
 
index 014a23e..c1213f9 100644 (file)
@@ -45,14 +45,14 @@ MoreOptDlgProc(HWND hwndDlg,
     PSETUPDATA pSetupData;
 
     /* Retrieve pointer to the global setup data */
-    pSetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
         case WM_INITDIALOG:
             /* Save pointer to the global setup data */
             pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pSetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
 
             CheckDlgButton(hwndDlg, IDC_INSTFREELDR, BST_CHECKED);
             SendMessage(GetDlgItem(hwndDlg, IDC_PATH),
@@ -157,7 +157,7 @@ DriveDlgProc(
 #endif
 
     /* Retrieve pointer to the global setup data */
-    pSetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -165,7 +165,7 @@ DriveDlgProc(
         {
             /* Save pointer to the global setup data */
             pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pSetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
 
             CreateListViewColumns(pSetupData->hInstance,
                                   GetDlgItem(hwndDlg, IDC_PARTITION));
index d5aa41e..14eb3dc 100644 (file)
@@ -92,14 +92,14 @@ StartDlgProc(HWND hwndDlg,
     PSETUPDATA pSetupData;
 
     /* Retrieve pointer to the global setup data */
-    pSetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
         case WM_INITDIALOG:
             /* Save pointer to the global setup data */
             pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pSetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
 
             /* Center the wizard window */
             CenterWindow(GetParent(hwndDlg));
@@ -145,14 +145,14 @@ TypeDlgProc(HWND hwndDlg,
     PSETUPDATA pSetupData;
 
     /* Retrieve pointer to the global setup data */
-    pSetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
         case WM_INITDIALOG:
             /* Save pointer to the global setup data */
             pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pSetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
 
             /* Check the 'install' radio button */
             CheckDlgButton(hwndDlg, IDC_INSTALL, BST_CHECKED);
@@ -213,14 +213,14 @@ DeviceDlgProc(HWND hwndDlg,
     HWND hList;
 
     /* Retrieve pointer to the global setup data */
-    pSetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
         case WM_INITDIALOG:
             /* Save pointer to the global setup data */
             pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pSetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
 
             hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
 
@@ -328,14 +328,14 @@ SummaryDlgProc(HWND hwndDlg,
     PSETUPDATA pSetupData;
 
     /* Retrieve pointer to the global setup data */
-    pSetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
         case WM_INITDIALOG:
             /* Save pointer to the global setup data */
             pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pSetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
             break;
 
         case WM_NOTIFY:
@@ -378,14 +378,14 @@ ProcessDlgProc(HWND hwndDlg,
     PSETUPDATA pSetupData;
 
     /* Retrieve pointer to the global setup data */
-    pSetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
         case WM_INITDIALOG:
             /* Save pointer to the global setup data */
             pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pSetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
             break;
 
         case WM_NOTIFY:
@@ -430,14 +430,14 @@ RestartDlgProc(HWND hwndDlg,
     PSETUPDATA pSetupData;
 
     /* Retrieve pointer to the global setup data */
-    pSetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
         case WM_INITDIALOG:
             /* Save pointer to the global setup data */
             pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pSetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
 
             /* Set title font */
             /*SendDlgItemMessage(hwndDlg,
index e6d9fe3..2d6ecf9 100644 (file)
@@ -56,12 +56,12 @@ EditVariableDlgProc(HWND hwndDlg,
     DWORD dwNameLength;
     DWORD dwValueLength;
 
-    VarData = (PVARIABLE_DATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+    VarData = (PVARIABLE_DATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
         case WM_INITDIALOG:
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (LONG_PTR)lParam);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
             VarData = (PVARIABLE_DATA)lParam;
 
             if (VarData->lpName != NULL)
index 9516c33..2d89021 100644 (file)
@@ -516,7 +516,7 @@ INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
             }
 
             InitLogo(hwndDlg);
-            SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_ROSIMG), GWL_WNDPROC, (LONG)RosImageProc);
+            SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_ROSIMG), GWLP_WNDPROC, (LONG_PTR)RosImageProc);
             GetSystemInformation(hwndDlg);
             break;
 
index fbd1dc3..237f916 100644 (file)
@@ -293,7 +293,7 @@ DateTimePageProc(HWND hwndDlg,
             SendMessageW(GetDlgItem(hwndDlg, IDC_YEAR), UDM_SETRANGE, 0, MAKELONG ((short) 9999, (short) 1900));
             SendMessageW(GetDlgItem(hwndDlg, IDC_YEAR), UDM_SETPOS, 0, MAKELONG( (short) st.wYear, 0));
 
-            pOldWndProc = (WNDPROC) SetWindowLongPtrW(GetDlgItem(hwndDlg, IDC_TIMEPICKER), GWL_WNDPROC, (INT_PTR) DTPProc);
+            pOldWndProc = (WNDPROC)SetWindowLongPtrW(GetDlgItem(hwndDlg, IDC_TIMEPICKER), GWLP_WNDPROC, (LONG_PTR)DTPProc);
             break;
 
         case WM_TIMER:
index bafeaed..b5730fc 100644 (file)
@@ -42,7 +42,7 @@ NetworkSettingsPageDlgProc(
     LPNMHDR lpnm;
 
     /* Retrieve pointer to the global setup data */
-    pNetworkSetupData = (PNETWORKSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    pNetworkSetupData = (PNETWORKSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
     if ((pNetworkSetupData != NULL) &&
         (pNetworkSetupData->dwMagic == NETWORK_SETUP_MAGIC))
         pSetupData = pNetworkSetupData->pSetupData;
@@ -52,7 +52,7 @@ NetworkSettingsPageDlgProc(
         case WM_INITDIALOG:
             /* Save pointer to the global setup data */
             pNetworkSetupData = (PNETWORKSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pNetworkSetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pNetworkSetupData);
             pSetupData = pNetworkSetupData->pSetupData;
 
             /* Set the fonts of both the options to bold */
@@ -127,7 +127,7 @@ NetworkComponentPageDlgProc(
     LPNMHDR lpnm;
 
     /* Retrieve pointer to the global setup data */
-    pNetworkSetupData = (PNETWORKSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    pNetworkSetupData = (PNETWORKSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
     if ((pNetworkSetupData != NULL) &&
         (pNetworkSetupData->dwMagic == NETWORK_SETUP_MAGIC))
         pSetupData = pNetworkSetupData->pSetupData;
@@ -137,7 +137,7 @@ NetworkComponentPageDlgProc(
         case WM_INITDIALOG:
             /* Save pointer to the global setup data */
             pNetworkSetupData = (PNETWORKSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pNetworkSetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pNetworkSetupData);
             pSetupData = pNetworkSetupData->pSetupData;
 
             SetBoldText(hwndDlg, IDC_NETWORK_DEVICE, pSetupData);
@@ -198,7 +198,7 @@ NetworkDomainPageDlgProc(
     LPNMHDR lpnm;
 
     /* Retrieve pointer to the global setup data */
-    pNetworkSetupData = (PNETWORKSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    pNetworkSetupData = (PNETWORKSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
     if ((pNetworkSetupData != NULL) &&
         (pNetworkSetupData->dwMagic == NETWORK_SETUP_MAGIC))
         pSetupData = pNetworkSetupData->pSetupData;
@@ -208,7 +208,7 @@ NetworkDomainPageDlgProc(
         case WM_INITDIALOG:
             /* Save pointer to the global setup data */
             pNetworkSetupData = (PNETWORKSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pNetworkSetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pNetworkSetupData);
             pSetupData = pNetworkSetupData->pSetupData;
 
             /* Set the workgroup option as the default */
@@ -237,7 +237,7 @@ NetworkDomainPageDlgProc(
                     (pNetworkSetupData->dwMagic == NETWORK_SETUP_MAGIC))
                     HeapFree(GetProcessHeap(), 0, pNetworkSetupData);
 
-                SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)NULL);
+                SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)NULL);
             }
             break;
 
index ada7650..7bc511b 100644 (file)
@@ -1402,10 +1402,10 @@ LRESULT CALLBACK CShellBrowser::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam,
     {
         if (uMsg == WM_NCDESTROY)
         {
-            saveWindowProc = reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hWnd, GWL_WNDPROC));
+            saveWindowProc = reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hWnd, GWLP_WNDPROC));
             lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
-            if (saveWindowProc == reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hWnd, GWL_WNDPROC)))
-                ::SetWindowLongPtr(hWnd, GWL_WNDPROC, (LONG_PTR)pThis->m_pfnSuperWindowProc);
+            if (saveWindowProc == reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hWnd, GWLP_WNDPROC)))
+                ::SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)pThis->m_pfnSuperWindowProc);
             pThis->m_dwState |= WINSTATE_DESTROYED;
         }
         else
index 8f91b32..1fc943b 100644 (file)
@@ -457,7 +457,7 @@ WelcomeDlgProc(
     UNREFERENCED_PARAMETER(wParam);
 
     /* Retrieve pointer to the global setup data */
-    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -468,7 +468,7 @@ WelcomeDlgProc(
 
             /* Get pointer to the global setup data */
             DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
 
             hwndControl = GetParent(hwndDlg);
 
@@ -567,7 +567,7 @@ CHSourceDlgProc(
     PDEVINSTDATA DevInstData;
 
     /* Retrieve pointer to the global setup data */
-    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -578,7 +578,7 @@ CHSourceDlgProc(
 
             /* Get pointer to the global setup data */
             DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
 
             hwndControl = GetParent(hwndDlg);
 
@@ -716,7 +716,7 @@ SearchDrvDlgProc(
     DWORD dwThreadId;
 
     /* Retrieve pointer to the global setup data */
-    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -727,7 +727,7 @@ SearchDrvDlgProc(
 
             /* Get pointer to the global setup data */
             DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
 
             DevInstData->hDialog = hwndDlg;
             hwndControl = GetParent(hwndDlg);
@@ -811,7 +811,7 @@ InstallDrvDlgProc(
     DWORD dwThreadId;
 
     /* Retrieve pointer to the global setup data */
-    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -822,7 +822,7 @@ InstallDrvDlgProc(
 
             /* Get pointer to the global setup data */
             DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
 
             DevInstData->hDialog = hwndDlg;
             hwndControl = GetParent(hwndDlg);
@@ -924,7 +924,7 @@ NoDriverDlgProc(
     UNREFERENCED_PARAMETER(wParam);
 
     /* Get pointer to the global setup data */
-    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -934,7 +934,7 @@ NoDriverDlgProc(
 
             /* Get pointer to the global setup data */
             DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
 
             /* Center the wizard window */
             CenterWindow(GetParent(hwndDlg));
@@ -1043,7 +1043,7 @@ InstallFailedDlgProc(
     UNREFERENCED_PARAMETER(wParam);
 
     /* Retrieve pointer to the global setup data */
-    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -1053,7 +1053,7 @@ InstallFailedDlgProc(
 
             /* Get pointer to the global setup data */
             DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
 
             /* Center the wizard window */
             CenterWindow(GetParent(hwndDlg));
@@ -1122,7 +1122,7 @@ NeedRebootDlgProc(
     UNREFERENCED_PARAMETER(wParam);
 
     /* Retrieve pointer to the global setup data */
-    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -1132,7 +1132,7 @@ NeedRebootDlgProc(
 
             /* Get pointer to the global setup data */
             DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
 
             /* Center the wizard window */
             CenterWindow(GetParent(hwndDlg));
@@ -1201,7 +1201,7 @@ FinishDlgProc(
     UNREFERENCED_PARAMETER(wParam);
 
     /* Retrieve pointer to the global setup data */
-    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+    DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -1211,7 +1211,7 @@ FinishDlgProc(
 
             /* Get pointer to the global setup data */
             DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
 
             /* Center the wizard window */
             CenterWindow(GetParent(hwndDlg));
index 6d3471e..4177ac2 100644 (file)
@@ -623,7 +623,7 @@ ImageView_InitControls(HWND hwnd)
                               0, 0, 0, 0, hwnd, NULL, hInstance, NULL);
 
     SetClassLongPtr(hDispWnd, GCL_STYLE, CS_HREDRAW | CS_VREDRAW);
-    PrevProc = (WNDPROC) SetWindowLongPtr(hDispWnd, GWL_WNDPROC, (LPARAM) ImageView_DispWndProc);
+    PrevProc = (WNDPROC) SetWindowLongPtr(hDispWnd, GWLP_WNDPROC, (LPARAM) ImageView_DispWndProc);
 
     ImageView_CreateToolBar(hwnd);
 }
@@ -794,7 +794,7 @@ ImageView_WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
         case WM_DESTROY:
         {
             ImageView_SaveSettings(hwnd);
-            SetWindowLongPtr(hDispWnd, GWL_WNDPROC, (LPARAM) PrevProc);
+            SetWindowLongPtr(hDispWnd, GWLP_WNDPROC, (LPARAM) PrevProc);
             PostQuitMessage(0);
             break;
         }
index 9ef4fd7..a4af15c 100644 (file)
@@ -943,7 +943,7 @@ LocalePageDlgProc(HWND hwndDlg,
     PSETUPDATA SetupData;
 
     /* Retrieve pointer to the global setup data */
-    SetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    SetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -951,7 +951,7 @@ LocalePageDlgProc(HWND hwndDlg,
         {
             /* Save pointer to the global setup data */
             SetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)SetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)SetupData);
             WriteUserLocale();
 
             SetKeyboardLayoutName(GetDlgItem(hwndDlg, IDC_LAYOUTTEXT));
@@ -1529,14 +1529,14 @@ DateTimePageDlgProc(HWND hwndDlg,
     PSETUPDATA SetupData;
 
     /* Retrieve pointer to the global setup data */
-    SetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    SetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
         case WM_INITDIALOG:
             /* Save pointer to the global setup data */
             SetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)SetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)SetupData);
 
             CreateTimeZoneList(SetupData);
 
@@ -1616,7 +1616,7 @@ ThemePageDlgProc(HWND hwndDlg,
     PSETUPDATA SetupData;
 
     /* Retrieve pointer to the global setup data */
-    SetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    SetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -1626,7 +1626,7 @@ ThemePageDlgProc(HWND hwndDlg,
 
             /* Save pointer to the global setup data */
             SetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)SetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)SetupData);
 
             imldata.himl = ImageList_LoadImage(hDllInstance, MAKEINTRESOURCE(IDB_CLASSIC), 0, 0, 0x00FF00FF, IMAGE_BITMAP, LR_CREATEDIBSECTION);
             SendDlgItemMessage(hwndDlg, IDC_CLASSICSTYLE, BCM_SETIMAGELIST, 0, (LPARAM)&imldata);
@@ -1963,7 +1963,7 @@ ProcessPageDlgProc(HWND hwndDlg,
     WCHAR Title[64];
 
     /* Retrieve pointer to the global setup data */
-    SetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
+    SetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -1971,7 +1971,7 @@ ProcessPageDlgProc(HWND hwndDlg,
         {
             /* Save pointer to the global setup data */
             SetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
-            SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)SetupData);
+            SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)SetupData);
         }
         break;
 
index d470daf..97b5add 100644 (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));
 
index e92ea5d..1b5388b 100644 (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)
index ffaf4e3..0a9aa3a 100644 (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;
index a8bbb85..c3fcc3a 100644 (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;
        }
 
index 9adea23..3fb05de 100644 (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:
index 90aeee2..ef4e5d0 100644 (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);
 }
index 2872061..2cb8897 100644 (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);
 
index 0564f7e..af8775e 100644 (file)
@@ -58,109 +58,109 @@ WinMain(HINSTANCE hInstance,
 
   hbtn[0] = CreateWindow(
     "BUTTON","BS_DEFPUSHBUTTON",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
-      10, 10, 200, 40, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      10, 10, 200, 40, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[1] = CreateWindow(
     "BUTTON","BS_3STATE",WS_VISIBLE | WS_CHILD | BS_3STATE,
-      10, 60, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      10, 60, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[2] = CreateWindow(
     "BUTTON","BS_AUTO3STATE",WS_VISIBLE | WS_CHILD | BS_AUTO3STATE,
-      10, 90, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      10, 90, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[3] = CreateWindow(
     "BUTTON","BS_AUTOCHECKBOX",WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
-      10, 120, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      10, 120, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[4] = CreateWindow(
     "BUTTON","BS_AUTORADIOBUTTON",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON,
-      10, 150, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      10, 150, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[5] = CreateWindow(
     "BUTTON","BS_CHECKBOX",WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
-      10, 180, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      10, 180, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[6] = CreateWindow(
     "BUTTON","BS_GROUPBOX",WS_VISIBLE | WS_CHILD | BS_GROUPBOX,
-      10, 210, 200, 80, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      10, 210, 200, 80, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[7] = CreateWindow(
     "BUTTON","BS_PUSHBUTTON",WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,
-      20, 230, 180, 30, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      20, 230, 180, 30, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[8] = CreateWindow(
     "BUTTON","BS_RADIOBUTTON",WS_VISIBLE | WS_CHILD | BS_RADIOBUTTON,
-      10, 300, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      10, 300, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[9] = CreateWindow(
     "BUTTON","BS_AUTORADIOBUTTON",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON,
-      220, 160, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      220, 160, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[10] = CreateWindow(
     "BUTTON","BS_DEFPUSHBUTTON|BS_BOTTOM",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_BOTTOM,
-      220, 10, 250, 40, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      220, 10, 250, 40, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[11] = CreateWindow(
     "BUTTON","BS_DEFPUSHBUTTON|BS_LEFT",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_LEFT,
-      480, 10, 250, 40, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      480, 10, 250, 40, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   hbtn[12] = CreateWindow(
     "BUTTON","BS_DEFPUSHBUTTON|BS_RIGHT|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_RIGHT |BS_MULTILINE,
-      740, 10, 150, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      740, 10, 150, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[13] = CreateWindow(
     "BUTTON","BS_AUTORADIOBUTTON|BS_TOP",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_TOP,
-      220, 60, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      220, 60, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    // Other Combinations
 
    hbtn[14] = CreateWindow(
     "BUTTON","BS_AUTORADIOBUTTON|BS_BOTTOM|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_BOTTOM | BS_MULTILINE,
-      480, 60, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      480, 60, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[15] = CreateWindow(
     "BUTTON","BS_AUTORADIOBUTTON|BS_LEFT",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_LEFT,
-      740, 80, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      740, 80, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[16] = CreateWindow(
     "BUTTON","BS_AUTORADIOBUTTON|BS_RIGHT|BS_TOP",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_RIGHT | BS_TOP,
-      220, 130, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      220, 130, 200, 20, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[17] = CreateWindow(
     "BUTTON","BS_AUTORADIOBUTTON|BS_TOP|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_TOP| BS_MULTILINE,
-      480, 130, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      480, 130, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[18] = CreateWindow(
     "BUTTON","BS_AUTOCHECKBOX|BS_BOTTOM|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | BS_BOTTOM | BS_MULTILINE,
-      740, 130, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      740, 130, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[19] = CreateWindow(
     "BUTTON","BS_AUTOCHECKBOX|BS_TOP|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE,
-      480, 190, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      480, 190, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[20] = CreateWindow(
     "BUTTON","BS_AUTOCHECKBOX|BS_LEFT|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | BS_LEFT | BS_MULTILINE,
-      220, 230, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      220, 230, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[21] = CreateWindow(
     "BUTTON","BS_AUTOCHECKBOX|BS_RIGHT|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | BS_RIGHT | BS_MULTILINE,
-      480, 240, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      480, 240, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[22] = CreateWindow(
     "BUTTON","BS_GROUPBOX|BS_TOP",WS_VISIBLE | WS_CHILD | BS_GROUPBOX | BS_TOP,
-      10, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      10, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[23] = CreateWindow(
     "BUTTON","BS_GROUPBOX|BS_BOTTOM",WS_VISIBLE | WS_CHILD | BS_GROUPBOX | BS_BOTTOM,
-      10, 410, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      10, 410, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[24] = CreateWindow(
     "BUTTON","BS_GROUPBOXBOX|BS_LEFT",WS_VISIBLE | WS_CHILD | BS_GROUPBOX | BS_LEFT,
-      520, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      520, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
    hbtn[25] = CreateWindow(
     "BUTTON","BS_GROUPBOX|BS_RIGHT|BS_BOTTOM",WS_VISIBLE | WS_CHILD | BS_GROUPBOX | BS_BOTTOM | BS_RIGHT,
-      300, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWL_HINSTANCE),NULL);
+      300, 340, 200, 60, hWnd, NULL, (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),NULL);
 
   while(GetMessage(&msg, NULL, 0, 0))
   {
index 8504dd2..5c1640c 100644 (file)
@@ -74,17 +74,17 @@ WinMain(HINSTANCE hInstance,
   printf("GetWindowTextA returned Ansi string \"%s\"\n", WindowTextA);
   printf("\n");
 
-  SavedWndProcW = (WNDPROC) GetWindowLongW(hWnd, GWL_WNDPROC);
+  SavedWndProcW = (WNDPROC) GetWindowLongPtrW(hWnd, GWLP_WNDPROC);
   printf("GetWindowLongW returned 0x%p\n", SavedWndProcW);
-  SavedWndProcA = (WNDPROC) GetWindowLongA(hWnd, GWL_WNDPROC);
+  SavedWndProcA = (WNDPROC) GetWindowLongPtrA(hWnd, GWLP_WNDPROC);
   printf("GetWindowLongA returned 0x%p\n", SavedWndProcA);
   printf("\n");
 
   printf("Subclassing window using SetWindowLongW, new WndProc 0x%p\n", UnicodeSubclassProc);
-  SetWindowLongW(hWnd, GWL_WNDPROC, (LONG) UnicodeSubclassProc);
+  SetWindowLongPtrW(hWnd, GWLP_WNDPROC, (LONG_PTR) UnicodeSubclassProc);
   printf("After subclass, IsWindowUnicode %s, WndProcA 0x%lx, WndProcW 0x%lx\n",
-         IsWindowUnicode(hWnd) ? "TRUE" : "FALSE", GetWindowLongA(hWnd, GWL_WNDPROC),
-         GetWindowLongW(hWnd, GWL_WNDPROC));
+         IsWindowUnicode(hWnd) ? "TRUE" : "FALSE", GetWindowLongPtrA(hWnd, GWLP_WNDPROC),
+         GetWindowLongPtrW(hWnd, GWLP_WNDPROC));
 
   printf("Calling GetWindowTextW\n");
   if (! GetWindowTextW(hWnd, WindowTextW, sizeof(WindowTextW) / sizeof(WindowTextW[0])))
@@ -96,10 +96,10 @@ WinMain(HINSTANCE hInstance,
   printf("\n");
 
   printf("Subclassing window using SetWindowLongA, new WndProc 0x%p\n", AnsiSubclassProc);
-  SetWindowLongA(hWnd, GWL_WNDPROC, (LONG) AnsiSubclassProc);
+  SetWindowLongPtrA(hWnd, GWLP_WNDPROC, (LONG_PTR) AnsiSubclassProc);
   printf("After subclass, IsWindowUnicode %s, WndProcA 0x%lx, WndProcW 0x%lx\n",
-         IsWindowUnicode(hWnd) ? "TRUE" : "FALSE", GetWindowLongA(hWnd, GWL_WNDPROC),
-         GetWindowLongW(hWnd, GWL_WNDPROC));
+         IsWindowUnicode(hWnd) ? "TRUE" : "FALSE", GetWindowLongPtrA(hWnd, GWLP_WNDPROC),
+         GetWindowLongPtrW(hWnd, GWLP_WNDPROC));
 
   printf("Calling GetWindowTextW\n");
   if (! GetWindowTextW(hWnd, WindowTextW, sizeof(WindowTextW) / sizeof(WindowTextW[0])))
index ade01ba..b8fd180 100644 (file)
@@ -122,7 +122,7 @@ void FormatBox(HWND hWnd, DWORD Flags, WCHAR *Caption, WCHAR *Format, ...)
 
 LRESULT CALLBACK WndSubclassProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
-       WND_DATA *data = (WND_DATA*)GetWindowLongPtr(hwnd, GWL_USERDATA);
+       WND_DATA *data = (WND_DATA*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
 
        if(uMsg == WM_INPUTLANGCHANGE)
        {
@@ -143,9 +143,9 @@ LRESULT CALLBACK WndSubclassProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
 void SubclassWnd(HWND hWnd, WCHAR* Name)
 {
        WND_DATA *data = HeapAlloc(GetProcessHeap(), 0, sizeof(WND_DATA));
-       data->OrigProc = (WNDPROC)SetWindowLongPtr( hWnd, GWL_WNDPROC, (LONG_PTR)WndSubclassProc);
+       data->OrigProc = (WNDPROC)SetWindowLongPtr( hWnd, GWLP_WNDPROC, (LONG_PTR)WndSubclassProc);
        wcsncpy(data->WndName, Name, 25);
-       SetWindowLongPtr(hWnd, GWL_USERDATA, (LONG_PTR)data);
+       SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)data);
        return;
 }
 
index fa7a0f5..530da54 100644 (file)
 #define GetWindowExStyle(hwnd) ((DWORD)GetWindowLong(hwnd,GWL_EXSTYLE))
 #define GetWindowFont(hwnd) FORWARD_WM_GETFONT((hwnd),SendMessage)
 #define GetWindowID(hwnd) GetDlgCtrlID(hwnd)
-#define GetWindowInstance(hwnd) ((HMODULE)GetWindowLong(hwnd,GWL_HINSTANCE))
+#define GetWindowInstance(hwnd) ((HMODULE)GetWindowLongPtr(hwnd,GWLP_HINSTANCE))
 #define GetWindowOwner(hwnd) GetWindow(hwnd,GW_OWNER)
 #define GetWindowStyle(hwnd) ((DWORD)GetWindowLong(hwnd,GWL_STYLE))
 #define GlobalAllocPtr(flags,cb) (GlobalLock(GlobalAlloc((flags),(cb))))
 #define Static_GetTextLength(hwndCtl) GetWindowTextLength(hwndCtl)
 #define Static_SetIcon(hwndCtl,hIcon) ((HICON)(UINT)(DWORD)SendMessage((hwndCtl),STM_SETICON,(WPARAM)(HICON)(hIcon),0))
 #define Static_SetText(hwndCtl,lpsz) SetWindowText((hwndCtl),(lpsz))
-#define SubclassDialog(hwndDlg,lpfn) ((DLGPROC)SetWindowLong(hwndDlg,DWL_DLGPROC,(LPARAM)(DLGPROC)(lpfn)))
-#define SubclassWindow(hwnd,lpfn) ((WNDPROC)SetWindowLong((hwnd),GWL_WNDPROC,(LPARAM)(WNDPROC)(lpfn)))
+#define SubclassDialog(hwndDlg,lpfn) ((DLGPROC)SetWindowLongPtr(hwndDlg,DWLP_DLGPROC,(LPARAM)(DLGPROC)(lpfn)))
+#define SubclassWindow(hwnd,lpfn) ((WNDPROC)SetWindowLongPtr((hwnd),GWLP_WNDPROC,(LPARAM)(WNDPROC)(lpfn)))
 #define SubtractRgn(hrgnResult,hrgnA,hrgnB) CombineRgn(hrgnResult,hrgnA,hrgnB,RGN_DIFF)
 #define UnionRgn(hrgnResult,hrgnA,hrgnB) CombineRgn(hrgnResult,hrgnA,hrgnB,RGN_OR)
 #define XorRgn(hrgnResult,hrgnA,hrgnB) CombineRgn(hrgnResult,hrgnA,hrgnB,RGN_XOR)