https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d281d14fd1291216c37b2…
commit d281d14fd1291216c37b2b94a96fc1461899eb91
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Feb 5 02:42:14 2018 +0100
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Mon Feb 19 22:36:36 2018 +0100
[REACTOS] Fix a number of Get/SetWindowsLong*Ptr* issues and use GWLP_* instead of
GWL_* where appropriate.
---
base/applications/games/solitaire/solitaire.cpp | 4 +-
base/applications/games/spider/spider.cpp | 4 +-
base/applications/mspaint/toolbox.cpp | 4 +-
base/applications/network/telnet/src/tnmisc.cpp | 4 +-
base/setup/reactos/drivepage.c | 8 ++--
base/setup/reactos/reactos.c | 24 +++++-----
dll/cpl/sysdm/environment.c | 4 +-
dll/cpl/sysdm/general.c | 2 +-
dll/cpl/timedate/dateandtime.c | 2 +-
dll/shellext/netshell/setup.cpp | 14 +++---
dll/win32/browseui/shellbrowser.cpp | 6 +--
dll/win32/newdev/wizard.c | 32 ++++++-------
dll/win32/shimgvw/shimgvw.c | 4 +-
dll/win32/syssetup/wizard.c | 16 +++----
.../applications/screensavers/ssstars/settings.c | 4 +-
.../applications/screensavers/ssstars/ssstars.c | 2 +-
modules/rosapps/lib/vfdlib/vfdguisave.c | 6 +--
modules/rosapps/lib/vfdlib/vfdguitip.c | 8 ++--
modules/rosapps/templates/mdi/childwnd.c | 4 +-
modules/rosapps/templates/mdi/framewnd.c | 2 +-
modules/rosapps/templates/mdi/panelwnd.c | 2 +-
modules/rostests/tests/button2/buttontst2.c | 52 +++++++++++-----------
modules/rostests/tests/subclass/subclass.c | 16 +++----
.../rostests/win32/user32/kbdlayout/kbdlayout.c | 6 +--
sdk/include/psdk/windowsx.h | 6 +--
25 files changed, 118 insertions(+), 118 deletions(-)
diff --git a/base/applications/games/solitaire/solitaire.cpp
b/base/applications/games/solitaire/solitaire.cpp
index 6eca4023c7..a5b9da40a7 100644
--- a/base/applications/games/solitaire/solitaire.cpp
+++ b/base/applications/games/solitaire/solitaire.cpp
@@ -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]);
}
diff --git a/base/applications/games/spider/spider.cpp
b/base/applications/games/spider/spider.cpp
index 519b534dc1..8b5ab8b9e2 100644
--- a/base/applications/games/spider/spider.cpp
+++ b/base/applications/games/spider/spider.cpp
@@ -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;
diff --git a/base/applications/mspaint/toolbox.cpp
b/base/applications/mspaint/toolbox.cpp
index 7455917092..6bf67b8849 100644
--- a/base/applications/mspaint/toolbox.cpp
+++ b/base/applications/mspaint/toolbox.cpp
@@ -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;
diff --git a/base/applications/network/telnet/src/tnmisc.cpp
b/base/applications/network/telnet/src/tnmisc.cpp
index abd30607e5..6c98739806 100644
--- a/base/applications/network/telnet/src/tnmisc.cpp
+++ b/base/applications/network/telnet/src/tnmisc.cpp
@@ -153,8 +153,8 @@ bool SetIcon(HWND hConsoleWindow, HANDLE hIcon, LPARAM *pOldBIcon,
LPARAM *pOldS
#else
// load the icon from the resource file -crn(a)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
diff --git a/base/setup/reactos/drivepage.c b/base/setup/reactos/drivepage.c
index 014a23ec9c..c1213f97e0 100644
--- a/base/setup/reactos/drivepage.c
+++ b/base/setup/reactos/drivepage.c
@@ -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));
diff --git a/base/setup/reactos/reactos.c b/base/setup/reactos/reactos.c
index d5aa41ecac..14eb3dc7f7 100644
--- a/base/setup/reactos/reactos.c
+++ b/base/setup/reactos/reactos.c
@@ -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,
diff --git a/dll/cpl/sysdm/environment.c b/dll/cpl/sysdm/environment.c
index e6d9fe39ae..2d6ecf9a17 100644
--- a/dll/cpl/sysdm/environment.c
+++ b/dll/cpl/sysdm/environment.c
@@ -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)
diff --git a/dll/cpl/sysdm/general.c b/dll/cpl/sysdm/general.c
index 9516c33756..2d89021d31 100644
--- a/dll/cpl/sysdm/general.c
+++ b/dll/cpl/sysdm/general.c
@@ -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;
diff --git a/dll/cpl/timedate/dateandtime.c b/dll/cpl/timedate/dateandtime.c
index fbd1dc39f5..237f916f7a 100644
--- a/dll/cpl/timedate/dateandtime.c
+++ b/dll/cpl/timedate/dateandtime.c
@@ -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:
diff --git a/dll/shellext/netshell/setup.cpp b/dll/shellext/netshell/setup.cpp
index bafeaed22c..b5730fc092 100644
--- a/dll/shellext/netshell/setup.cpp
+++ b/dll/shellext/netshell/setup.cpp
@@ -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;
diff --git a/dll/win32/browseui/shellbrowser.cpp b/dll/win32/browseui/shellbrowser.cpp
index ada76502b3..7bc511b338 100644
--- a/dll/win32/browseui/shellbrowser.cpp
+++ b/dll/win32/browseui/shellbrowser.cpp
@@ -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
diff --git a/dll/win32/newdev/wizard.c b/dll/win32/newdev/wizard.c
index 8f91b324aa..1fc943bede 100644
--- a/dll/win32/newdev/wizard.c
+++ b/dll/win32/newdev/wizard.c
@@ -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));
diff --git a/dll/win32/shimgvw/shimgvw.c b/dll/win32/shimgvw/shimgvw.c
index 6d3471e8d4..4177ac2d68 100644
--- a/dll/win32/shimgvw/shimgvw.c
+++ b/dll/win32/shimgvw/shimgvw.c
@@ -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;
}
diff --git a/dll/win32/syssetup/wizard.c b/dll/win32/syssetup/wizard.c
index 9ef4fd755b..a4af15c792 100644
--- a/dll/win32/syssetup/wizard.c
+++ b/dll/win32/syssetup/wizard.c
@@ -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;
diff --git a/modules/rosapps/applications/screensavers/ssstars/settings.c
b/modules/rosapps/applications/screensavers/ssstars/settings.c
index d470dafe54..97b5addc7a 100644
--- a/modules/rosapps/applications/screensavers/ssstars/settings.c
+++ b/modules/rosapps/applications/screensavers/ssstars/settings.c
@@ -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));
diff --git a/modules/rosapps/applications/screensavers/ssstars/ssstars.c
b/modules/rosapps/applications/screensavers/ssstars/ssstars.c
index e92ea5d7ed..1b5388bf88 100644
--- a/modules/rosapps/applications/screensavers/ssstars/ssstars.c
+++ b/modules/rosapps/applications/screensavers/ssstars/ssstars.c
@@ -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)
diff --git a/modules/rosapps/lib/vfdlib/vfdguisave.c
b/modules/rosapps/lib/vfdlib/vfdguisave.c
index ffaf4e329f..0a9aa3ae02 100644
--- a/modules/rosapps/lib/vfdlib/vfdguisave.c
+++ b/modules/rosapps/lib/vfdlib/vfdguisave.c
@@ -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;
diff --git a/modules/rosapps/lib/vfdlib/vfdguitip.c
b/modules/rosapps/lib/vfdlib/vfdguitip.c
index a8bbb8586e..c3fcc3a769 100644
--- a/modules/rosapps/lib/vfdlib/vfdguitip.c
+++ b/modules/rosapps/lib/vfdlib/vfdguitip.c
@@ -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;
}
diff --git a/modules/rosapps/templates/mdi/childwnd.c
b/modules/rosapps/templates/mdi/childwnd.c
index 9adea23c6a..3fb05deaa3 100644
--- a/modules/rosapps/templates/mdi/childwnd.c
+++ b/modules/rosapps/templates/mdi/childwnd.c
@@ -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:
diff --git a/modules/rosapps/templates/mdi/framewnd.c
b/modules/rosapps/templates/mdi/framewnd.c
index 90aeee204d..ef4e5d0d46 100644
--- a/modules/rosapps/templates/mdi/framewnd.c
+++ b/modules/rosapps/templates/mdi/framewnd.c
@@ -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);
}
diff --git a/modules/rosapps/templates/mdi/panelwnd.c
b/modules/rosapps/templates/mdi/panelwnd.c
index 2872061345..2cb889736e 100644
--- a/modules/rosapps/templates/mdi/panelwnd.c
+++ b/modules/rosapps/templates/mdi/panelwnd.c
@@ -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);
diff --git a/modules/rostests/tests/button2/buttontst2.c
b/modules/rostests/tests/button2/buttontst2.c
index 0564f7ec7b..af8775e806 100644
--- a/modules/rostests/tests/button2/buttontst2.c
+++ b/modules/rostests/tests/button2/buttontst2.c
@@ -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))
{
diff --git a/modules/rostests/tests/subclass/subclass.c
b/modules/rostests/tests/subclass/subclass.c
index 8504dd294a..5c1640c08c 100644
--- a/modules/rostests/tests/subclass/subclass.c
+++ b/modules/rostests/tests/subclass/subclass.c
@@ -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])))
diff --git a/modules/rostests/win32/user32/kbdlayout/kbdlayout.c
b/modules/rostests/win32/user32/kbdlayout/kbdlayout.c
index ade01ba195..b8fd1800c2 100644
--- a/modules/rostests/win32/user32/kbdlayout/kbdlayout.c
+++ b/modules/rostests/win32/user32/kbdlayout/kbdlayout.c
@@ -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;
}
diff --git a/sdk/include/psdk/windowsx.h b/sdk/include/psdk/windowsx.h
index fa7a0f5d82..530da54970 100644
--- a/sdk/include/psdk/windowsx.h
+++ b/sdk/include/psdk/windowsx.h
@@ -285,7 +285,7 @@
#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))))
@@ -494,8 +494,8 @@
#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)