return 1;
if (!_tcscmp(ClassName, TEXT("Button"))) {
- DWORD dwStyle = GetWindowLong(hCtlWnd, GWL_STYLE) & 0xF;
+ DWORD dwStyle = GetWindowLongPtr(hCtlWnd, GWL_STYLE) & 0xF;
/* Set states for press/release, but only for push buttons */
if (dwStyle == BS_PUSHBUTTON || dwStyle == BS_DEFPUSHBUTTON || dwStyle == BS_OWNERDRAW) {
popup.rcMargins.bottom = -1;
popup.rcMargins.left = -1;
popup.rcMargins.right = -1;
- popup.idString = GetWindowLong((HWND)wp, GWL_ID);
+ popup.idString = GetWindowLongPtr((HWND)wp, GWL_ID);
HtmlHelp((HWND)wp, HTMLHELP_PATH("/popups.txt"), HH_DISPLAY_TEXT_POPUP, (DWORD_PTR)&popup);
}
#endif
//
LRESULT CALLBACK CardWindow::CardWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
- CardWindow *cw = (CardWindow *)GetWindowLong(hwnd, 0);
+ CardWindow *cw = (CardWindow *)GetWindowLongPtr(hwnd, 0);
return cw->WndProc(hwnd, iMsg, wParam, lParam);
}
//
// associate this class with the window
//
- SetWindowLong(hwnd, 0, (LONG_PTR)cs->lpCreateParams);
+ SetWindowLongPtr(hwnd, 0, (LONG_PTR)cs->lpCreateParams);
return 1;
SetListViewStyle(HWND hListView,\r
DWORD View)\r
{\r
- DWORD Style = GetWindowLong(hListView, GWL_STYLE);\r
+ DWORD Style = GetWindowLongPtr(hListView, GWL_STYLE);\r
\r
if ((Style & LVS_TYPEMASK) != View)\r
{\r
- SetWindowLong(hListView,\r
- GWL_STYLE,\r
- (Style & ~LVS_TYPEMASK) | View);\r
+ SetWindowLongPtr(hListView,\r
+ GWL_STYLE,\r
+ (Style & ~LVS_TYPEMASK) | View);\r
}\r
}\r
\r
height = (prect->bottom - prect->top) - (g_yoff + g_xoff);
if (height < g_height || width < g_width)
{
- style = GetWindowLong(g_Wnd, GWL_STYLE);
+ style = GetWindowLongPtr(g_Wnd, GWL_STYLE);
if (!(style & WS_HSCROLL))
{
style |= WS_HSCROLL | WS_VSCROLL;
- SetWindowLong(g_Wnd, GWL_STYLE, style);
+ SetWindowLongPtr(g_Wnd, GWL_STYLE, style);
g_xscroll = 0;
g_yscroll = 0;
SetScrollPos(g_Wnd, SB_HORZ, g_xscroll, 1);
}
else if (height >= g_height && width >= g_width)
{
- style = GetWindowLong(g_Wnd, GWL_STYLE);
+ style = GetWindowLongPtr(g_Wnd, GWL_STYLE);
if (style & WS_HSCROLL)
{
style &= ~WS_HSCROLL;
style &= ~WS_VSCROLL;
- SetWindowLong(g_Wnd, GWL_STYLE, style);
+ SetWindowLongPtr(g_Wnd, GWL_STYLE, style);
g_xscroll = 0;
g_yscroll = 0;
}
#else
// load the icon from the resource file -crn@ozemail.com.au 16/12/98
if(!hIcon) {
- hIcon = LoadIcon ((HANDLE)GetWindowLong(hConsoleWindow,
+ hIcon = LoadIcon ((HANDLE)GetWindowLongPtr(hConsoleWindow,
GWL_HINSTANCE), "TELNETICON");
}
#endif
hControl = GetDlgItem(hDlg, IDC_LOOKAT_VALUES);
if (hControl)
{
- lStyle = GetWindowLong(hControl, GWL_STYLE);
- SetWindowLong(hControl, GWL_STYLE, lStyle | WS_DISABLED);
+ lStyle = GetWindowLongPtr(hControl, GWL_STYLE);
+ SetWindowLongPtr(hControl, GWL_STYLE, lStyle | WS_DISABLED);
}
/* Looking at data is not yet implemented */
hControl = GetDlgItem(hDlg, IDC_LOOKAT_DATA);
if (hControl)
{
- lStyle = GetWindowLong(hControl, GWL_STYLE);
- SetWindowLong(hControl, GWL_STYLE, lStyle | WS_DISABLED);
+ lStyle = GetWindowLongPtr(hControl, GWL_STYLE);
+ SetWindowLongPtr(hControl, GWL_STYLE, lStyle | WS_DISABLED);
}
/* Match whole string */
hControl = GetDlgItem(hDlg, IDOK);
if (hControl)
{
- lStyle = GetWindowLong(hControl, GWL_STYLE);
+ lStyle = GetWindowLongPtr(hControl, GWL_STYLE);
if (s_szSavedFindValue[0])
lStyle &= ~WS_DISABLED;
else
lStyle |= WS_DISABLED;
- SetWindowLong(hControl, GWL_STYLE, lStyle);
+ SetWindowLongPtr(hControl, GWL_STYLE, lStyle);
RedrawWindow(hControl, NULL, NULL, RDW_INVALIDATE);
}
break;
INT bufsize, cvislines;
GetClientRect(hed->hWndSelf, &rcClient);
- hed->style = GetWindowLong(hed->hWndSelf, GWL_STYLE);
+ hed->style = GetWindowLongPtr(hed->hWndSelf, GWL_STYLE);
bufsize = (hed->hBuffer ? (INT) LocalSize(hed->hBuffer) : 0);
hed->nLines = max(bufsize / hed->ColumnsPerLine, 1);
void UpdateApplicationListControlViewSetting(void)
{
- DWORD dwStyle = GetWindowLongW(hApplicationPageListCtrl, GWL_STYLE);
+ DWORD dwStyle = GetWindowLongPtrW(hApplicationPageListCtrl, GWL_STYLE);
dwStyle &= ~(LVS_REPORT | LVS_ICON | LVS_LIST | LVS_SMALLICON);
case ID_VIEW_SMALL: dwStyle |= LVS_SMALLICON; break;
case ID_VIEW_DETAILS: dwStyle |= LVS_REPORT; break;
}
- SetWindowLongW(hApplicationPageListCtrl, GWL_STYLE, dwStyle);
+ SetWindowLongPtrW(hApplicationPageListCtrl, GWL_STYLE, dwStyle);
RefreshApplicationPage();
}
!IsWindowVisible(hWnd) ||
(GetParent(hWnd) != NULL) ||
(GetWindow(hWnd, GW_OWNER) != NULL) ||
- (GetWindowLongW(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW))
+ (GetWindowLongPtrW(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW))
{
return TRUE; /* Skip this window */
}
!IsWindowVisible(pAPLI->hWnd) ||
(GetParent(pAPLI->hWnd) != NULL) ||
(GetWindow(pAPLI->hWnd, GW_OWNER) != NULL) ||
- (GetWindowLongW(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW))
+ (GetWindowLongPtrW(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW))
{
ImageList_Remove(hImageListLarge, item.iItem);
ImageList_Remove(hImageListSmall, item.iItem);
hdc = BeginPaint(hWnd, &ps);
- WindowId = GetWindowLongW(hWnd, GWL_ID);
+ WindowId = GetWindowLongPtrW(hWnd, GWL_ID);
switch (WindowId)
{
* Check or uncheck the always on top menu item
* and update main window.
*/
- if ((GetWindowLongW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0)
+ if ((GetWindowLongPtrW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0)
{
CheckMenuItem(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_UNCHECKED);
TaskManagerSettings.AlwaysOnTop = FALSE;
GetCursorPos(&pt);
- OnTop = ((GetWindowLongW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
+ OnTop = ((GetWindowLongPtrW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_TRAY_POPUP));
hPopupMenu = GetSubMenu(hMenu, 0);
hMenu = GetMenu(hMainWnd);
hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
- OnTop = ((GetWindowLongW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
+ OnTop = ((GetWindowLongPtrW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
OpenIcon(hMainWnd);
SetForegroundWindow(hMainWnd);
/* Center the wizard window */
CenterWindow (hwndControl);
- dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
- SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
+ dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
+ SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
/* Hide and disable the 'Cancel' button at the moment,
* we use this button to cancel the setup process
hwndControl = GetParent(hwndDlg);
- dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
- SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
+ dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
+ SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
ShowWindow (hwndControl, SW_SHOW);
break;
case PSN_QUERYCANCEL:
- SetWindowLong(hwndDlg,
- DWL_MSGRESULT,
- MessageBox(GetParent(hwndDlg),
+ SetWindowLongPtr(hwndDlg,
+ DWL_MSGRESULT,
+ MessageBox(GetParent(hwndDlg),
abort_msg,
abort_title,
MB_YESNO | MB_ICONQUESTION) != IDYES);
hwndControl = GetParent(hwndDlg);
- dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
- SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
+ dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
+ SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
CheckDlgButton(hwndDlg, IDC_INSTALL, BST_CHECKED);
break;
case PSN_QUERYCANCEL:
- SetWindowLong(hwndDlg,
- DWL_MSGRESULT,
- MessageBox(GetParent(hwndDlg),
+ SetWindowLongPtr(hwndDlg,
+ DWL_MSGRESULT,
+ MessageBox(GetParent(hwndDlg),
abort_msg,
abort_title,
MB_YESNO | MB_ICONQUESTION) != IDYES);
hwndControl = GetParent(hwndDlg);
- dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
- SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
+ dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
+ SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
/* Set title font */
/*SendDlgItemMessage(hwndDlg,
break;
case PSN_QUERYCANCEL:
- SetWindowLong(hwndDlg,
- DWL_MSGRESULT,
- MessageBox(GetParent(hwndDlg),
+ SetWindowLongPtr(hwndDlg,
+ DWL_MSGRESULT,
+ MessageBox(GetParent(hwndDlg),
abort_msg,
abort_title,
MB_YESNO | MB_ICONQUESTION) != IDYES);
hwndControl = GetParent(hwndDlg);
- dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
- SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
+ dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
+ SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
/* Set title font */
/*SendDlgItemMessage(hwndDlg,
break;
case PSN_QUERYCANCEL:
- SetWindowLong(hwndDlg,
- DWL_MSGRESULT,
- MessageBox(GetParent(hwndDlg),
+ SetWindowLongPtr(hwndDlg,
+ DWL_MSGRESULT,
+ MessageBox(GetParent(hwndDlg),
abort_msg,
abort_title,
MB_YESNO | MB_ICONQUESTION) != IDYES);
hwndControl = GetParent(hwndDlg);
- dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
- SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
+ dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
+ SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
ShowWindow(hwndControl, SW_HIDE);
hwndControl = GetParent(hwndDlg);
- dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
- SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
+ dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
+ SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
ShowWindow(hwndControl, SW_HIDE);
hwndControl = GetParent(hwndDlg);
- dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
- SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
+ dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
+ SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
/* Set title font */
/*SendDlgItemMessage(hwndDlg,
{
if(DriverFilesFound)
{
- SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CONFIG);
+ SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, IDD_CONFIG);
return TRUE;
}
break;
PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_NEXT);
break;
case PSN_WIZNEXT:
- SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_INSTALLING_VMWARE_TOOLS);
+ SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, IDD_INSTALLING_VMWARE_TOOLS);
break;
}
break;
{
PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
InstTerminateInstaller(FALSE);
- SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
+ SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, -1);
return -1;
}
else
{
SendDlgItemMessage(hwndDlg, IDC_INSTALLINGPROGRESS, PBM_SETMARQUEE, FALSE, 0);
- SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_INSERT_VMWARE_TOOLS);
+ SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, IDD_INSERT_VMWARE_TOOLS);
}
break;
}
{
if(StartVMwConfigWizard)
{
- SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CHOOSEACTION);
+ SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, IDD_CHOOSEACTION);
return TRUE;
}
if(DriverFilesFound)
{
- SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_WELCOMEPAGE);
+ SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, IDD_WELCOMEPAGE);
return TRUE;
}
break;
break;
case PSN_WIZBACK:
{
- SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CHOOSEACTION);
+ SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, IDD_CHOOSEACTION);
return TRUE;
}
case PSN_WIZNEXT:
UninstallDriver = (i == IDC_UNINSTALL);
- SetWindowLong(hwndDlg, DWL_MSGRESULT, SelPage[i - IDC_CONFIGSETTINGS]);
+ SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, SelPage[i - IDC_CONFIGSETTINGS]);
return TRUE;
}
}
break;
case PSN_WIZBACK:
{
- SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CHOOSEACTION);
+ SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, IDD_CHOOSEACTION);
return TRUE;
}
case PSN_WIZNEXT:
WCHAR Msg[1024];
LoadString(hAppInstance, (ActivateVBE ? IDS_FAILEDTOSELVBEDRIVER : IDS_FAILEDTOSELVGADRIVER), Msg, sizeof(Msg) / sizeof(WCHAR));
MessageBox(GetParent(hwndDlg), Msg, NULL, MB_ICONWARNING);
- SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_SELECTDRIVER);
+ SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, IDD_SELECTDRIVER);
return TRUE;
}
break;
WCHAR Msg[1024];
LoadString(hAppInstance, (ActivateVBE ? IDS_FAILEDTOSELVBEDRIVER : IDS_FAILEDTOSELVGADRIVER), Msg, sizeof(Msg) / sizeof(WCHAR));
MessageBox(GetParent(hwndDlg), Msg, NULL, MB_ICONWARNING);
- SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_SELECTDRIVER);
+ SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, IDD_SELECTDRIVER);
return TRUE;
}
ShowUninstNotice(GetParent(hwndDlg));
if (uMsg == WM_MOUSEMOVE)
{
- i = GetWindowLong(hWnd, GWL_ID);
+ i = GetWindowLongPtr(hWnd, GWL_ID);
if (nTopic != i)
{
nTopic = i;
ASSERT((~dwStyleMask & dwStyle) == 0);
- PrevStyle = GetWindowLong(hWnd,
- GWL_STYLE);
+ PrevStyle = GetWindowLongPtr(hWnd,
+ GWL_STYLE);
if (PrevStyle != 0 &&
(PrevStyle & dwStyleMask) != dwStyle)
{
Style = PrevStyle & ~dwStyleMask;
Style |= dwStyle;
- PrevStyle = SetWindowLong(hWnd,
- GWL_STYLE,
- Style);
+ PrevStyle = SetWindowLongPtr(hWnd,
+ GWL_STYLE,
+ Style);
}
return PrevStyle;
ASSERT((~dwStyleMask & dwStyle) == 0);
- PrevStyle = GetWindowLong(hWnd,
- GWL_EXSTYLE);
+ PrevStyle = GetWindowLongPtr(hWnd,
+ GWL_EXSTYLE);
if (PrevStyle != 0 &&
(PrevStyle & dwStyleMask) != dwStyle)
{
Style = PrevStyle & ~dwStyleMask;
Style |= dwStyle;
- PrevStyle = SetWindowLong(hWnd,
- GWL_EXSTYLE,
- Style);
+ PrevStyle = SetWindowLongPtr(hWnd,
+ GWL_EXSTYLE,
+ Style);
}
return PrevStyle;
/* Don't list popup windows and also no tool windows */
if (GetWindow(hWnd,
GW_OWNER) == NULL &&
- !(GetWindowLong(hWnd,
- GWL_EXSTYLE) & WS_EX_TOOLWINDOW))
+ !(GetWindowLongPtr(hWnd,
+ GWL_EXSTYLE) & WS_EX_TOOLWINDOW))
{
TaskSwitchWnd_AddTask(This,
hWnd);
NMHDR nmh;
nmh.hwndFrom = This->hWnd;
- nmh.idFrom = GetWindowLong(This->hWnd,
- GWL_ID);
+ nmh.idFrom = GetWindowLongPtr(This->hWnd,
+ GWL_ID);
nmh.code = NTNWM_REALIGN;
SendMessage(This->hWndNotify,
RECT rcClient = { 0, 0, 0, 0 };
if (AdjustWindowRectEx(&rcClient,
- GetWindowLong(This->hWnd,
- GWL_STYLE),
+ GetWindowLongPtr(This->hWnd,
+ GWL_STYLE),
FALSE,
- GetWindowLong(This->hWnd,
- GWL_EXSTYLE)))
+ GetWindowLongPtr(This->hWnd,
+ GWL_EXSTYLE)))
{
This->szNonClient.cx = rcClient.right - rcClient.left;
This->szNonClient.cy = rcClient.bottom - rcClient.top;
RECT rcMin = {0};
AdjustWindowRectEx(&rcMin,
- GetWindowLong(This->hWnd,
- GWL_STYLE),
+ GetWindowLongPtr(This->hWnd,
+ GWL_STYLE),
FALSE,
- GetWindowLong(This->hWnd,
- GWL_EXSTYLE));
+ GetWindowLongPtr(This->hWnd,
+ GWL_EXSTYLE));
*pRect = rcMin;
}
{
switch(pnmh->code) {
case PSN_QUERYINITIALFOCUS:
- SetWindowLong(_hwnd, DWL_MSGRESULT, (LPARAM)GetDlgItem(_hwnd, IDC_ICON_ALIGN_0+_alignment_cur));
+ SetWindowLongPtr(_hwnd, DWL_MSGRESULT, (LPARAM)GetDlgItem(_hwnd, IDC_ICON_ALIGN_0+_alignment_cur));
break;
case PSN_APPLY:
#endif
-#define SetDlgCtrlID(hwnd, id) SetWindowLong(hwnd, GWL_ID, id)
-#define SetWindowStyle(hwnd, val) (DWORD)SetWindowLong(hwnd, GWL_STYLE, val)
-#define SetWindowExStyle(h, val) (DWORD)SetWindowLong(hwnd, GWL_EXSTYLE, val)
+#define SetDlgCtrlID(hwnd, id) SetWindowLongPtr(hwnd, GWL_ID, id)
+#define SetWindowStyle(hwnd, val) (DWORD)SetWindowLongPtr(hwnd, GWL_STYLE, val)
+#define SetWindowExStyle(h, val) (DWORD)SetWindowLongPtr(hwnd, GWL_EXSTYLE, val)
#define Window_SetIcon(hwnd, type, hicon) (HICON)SendMessage(hwnd, WM_SETICON, type, (LPARAM)(hicon))
return TRUE; // message has been processed
case WM_NOTIFYFORMAT:
- SetWindowLong(hwnd, DWLP_MSGRESULT, NFR_CURRENT); // set return value NFR_CURRENT
+ SetWindowLongPtr(hwnd, DWLP_MSGRESULT, NFR_CURRENT); // set return value NFR_CURRENT
return TRUE; // message has been processed
case WM_NCDESTROY:
return TRUE; // message has been processed
case WM_NOTIFYFORMAT:
- SetWindowLong(hwnd, DWLP_MSGRESULT, NFR_CURRENT); // set return value NFR_CURRENT
+ SetWindowLongPtr(hwnd, DWLP_MSGRESULT, NFR_CURRENT); // set return value NFR_CURRENT
return TRUE; // message has been processed
case WM_NCDESTROY: