Cygwin/X: Update Get/SetWindowLong() to Get/SetWindowLongPtr() everywhere
Get/SetWindowLong() is superseded by Get/SetWindowLongPtr(), so change to using that everywhere it remains Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This commit is contained in:
parent
c81595e23b
commit
b3751454cb
|
@ -150,7 +150,7 @@ winURLWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
SetCursor (cursor);
|
||||
return TRUE;
|
||||
}
|
||||
origCB = (WNDPROC)GetWindowLong (hwnd, GWL_USERDATA);
|
||||
origCB = (WNDPROC)GetWindowLongPtr(hwnd, GWL_USERDATA);
|
||||
/* Otherwise fall through to original WndProc */
|
||||
if (origCB)
|
||||
return CallWindowProc (origCB, hwnd, msg, wParam, lParam);
|
||||
|
@ -167,19 +167,19 @@ static void
|
|||
winOverrideURLButton (HWND hwnd, int id)
|
||||
{
|
||||
WNDPROC origCB;
|
||||
origCB = (WNDPROC)SetWindowLong (GetDlgItem (hwnd, id),
|
||||
GWL_WNDPROC, (LONG)winURLWndProc);
|
||||
SetWindowLong (GetDlgItem (hwnd, id), GWL_USERDATA, (LONG)origCB);
|
||||
origCB = (WNDPROC)SetWindowLongPtr(GetDlgItem (hwnd, id),
|
||||
GWL_WNDPROC, (LONG_PTR)winURLWndProc);
|
||||
SetWindowLongPtr(GetDlgItem (hwnd, id), GWL_USERDATA, (LONG_PTR)origCB);
|
||||
}
|
||||
|
||||
static void
|
||||
winUnoverrideURLButton (HWND hwnd, int id)
|
||||
{
|
||||
WNDPROC origCB;
|
||||
origCB = (WNDPROC)SetWindowLong (GetDlgItem (hwnd, id),
|
||||
GWL_USERDATA, 0);
|
||||
origCB = (WNDPROC)SetWindowLongPtr(GetDlgItem (hwnd, id),
|
||||
GWL_USERDATA, 0);
|
||||
if (origCB)
|
||||
SetWindowLong (GetDlgItem (hwnd, id), GWL_WNDPROC, (LONG)origCB);
|
||||
SetWindowLongPtr(GetDlgItem (hwnd, id), GWL_WNDPROC, (LONG_PTR)origCB);
|
||||
}
|
||||
|
||||
|
||||
|
@ -200,13 +200,13 @@ winInitDialog (HWND hwndDlg)
|
|||
hwndDesk = GetDesktopWindow ();
|
||||
|
||||
/* Remove minimize and maximize buttons */
|
||||
SetWindowLong (hwndDlg, GWL_STYLE,
|
||||
GetWindowLong (hwndDlg, GWL_STYLE)
|
||||
& ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
|
||||
SetWindowLongPtr(hwndDlg, GWL_STYLE,
|
||||
GetWindowLongPtr(hwndDlg, GWL_STYLE)
|
||||
& ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
|
||||
|
||||
/* Set Window not to show in the task bar */
|
||||
SetWindowLong (hwndDlg, GWL_EXSTYLE,
|
||||
GetWindowLong (hwndDlg, GWL_EXSTYLE) & ~WS_EX_APPWINDOW );
|
||||
SetWindowLongPtr(hwndDlg, GWL_EXSTYLE,
|
||||
GetWindowLongPtr(hwndDlg, GWL_EXSTYLE) & ~WS_EX_APPWINDOW );
|
||||
|
||||
/* Center dialog window in the screen. Not done for multi-monitor systems, where
|
||||
* it is likely to end up split across the screens. In that case, it appears
|
||||
|
|
|
@ -575,7 +575,7 @@ winCreateWindowsWindow (WindowPtr pWin)
|
|||
if (hIconSmall) SendMessage (hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall);
|
||||
|
||||
/* Change style back to popup, already placed... */
|
||||
SetWindowLong (hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
|
||||
SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
|
||||
SetWindowPos (hWnd, 0, 0, 0, 0, 0,
|
||||
SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
|
||||
/* Make sure it gets the proper system menu for a WS_POPUP, too */
|
||||
|
|
|
@ -313,7 +313,7 @@ HandleCustomWM_INITMENU(unsigned long hwndIn,
|
|||
if (!hwnd || !hmenu)
|
||||
return;
|
||||
|
||||
if (GetWindowLong (hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)
|
||||
if (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)
|
||||
dwExStyle = MF_BYCOMMAND | MF_CHECKED;
|
||||
else
|
||||
dwExStyle = MF_BYCOMMAND | MF_UNCHECKED;
|
||||
|
@ -408,7 +408,7 @@ HandleCustomWM_COMMAND (unsigned long hwndIn,
|
|||
return FALSE;
|
||||
|
||||
/* Get extended window style */
|
||||
dwExStyle = GetWindowLong (hwnd, GWL_EXSTYLE);
|
||||
dwExStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
|
||||
|
||||
/* Handle topmost windows */
|
||||
if (dwExStyle & WS_EX_TOPMOST)
|
||||
|
|
Loading…
Reference in New Issue
Block a user