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);
|
SetCursor (cursor);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
origCB = (WNDPROC)GetWindowLong (hwnd, GWL_USERDATA);
|
origCB = (WNDPROC)GetWindowLongPtr(hwnd, GWL_USERDATA);
|
||||||
/* Otherwise fall through to original WndProc */
|
/* Otherwise fall through to original WndProc */
|
||||||
if (origCB)
|
if (origCB)
|
||||||
return CallWindowProc (origCB, hwnd, msg, wParam, lParam);
|
return CallWindowProc (origCB, hwnd, msg, wParam, lParam);
|
||||||
|
@ -167,19 +167,19 @@ static void
|
||||||
winOverrideURLButton (HWND hwnd, int id)
|
winOverrideURLButton (HWND hwnd, int id)
|
||||||
{
|
{
|
||||||
WNDPROC origCB;
|
WNDPROC origCB;
|
||||||
origCB = (WNDPROC)SetWindowLong (GetDlgItem (hwnd, id),
|
origCB = (WNDPROC)SetWindowLongPtr(GetDlgItem (hwnd, id),
|
||||||
GWL_WNDPROC, (LONG)winURLWndProc);
|
GWL_WNDPROC, (LONG_PTR)winURLWndProc);
|
||||||
SetWindowLong (GetDlgItem (hwnd, id), GWL_USERDATA, (LONG)origCB);
|
SetWindowLongPtr(GetDlgItem (hwnd, id), GWL_USERDATA, (LONG_PTR)origCB);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
winUnoverrideURLButton (HWND hwnd, int id)
|
winUnoverrideURLButton (HWND hwnd, int id)
|
||||||
{
|
{
|
||||||
WNDPROC origCB;
|
WNDPROC origCB;
|
||||||
origCB = (WNDPROC)SetWindowLong (GetDlgItem (hwnd, id),
|
origCB = (WNDPROC)SetWindowLongPtr(GetDlgItem (hwnd, id),
|
||||||
GWL_USERDATA, 0);
|
GWL_USERDATA, 0);
|
||||||
if (origCB)
|
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 ();
|
hwndDesk = GetDesktopWindow ();
|
||||||
|
|
||||||
/* Remove minimize and maximize buttons */
|
/* Remove minimize and maximize buttons */
|
||||||
SetWindowLong (hwndDlg, GWL_STYLE,
|
SetWindowLongPtr(hwndDlg, GWL_STYLE,
|
||||||
GetWindowLong (hwndDlg, GWL_STYLE)
|
GetWindowLongPtr(hwndDlg, GWL_STYLE)
|
||||||
& ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
|
& ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
|
||||||
|
|
||||||
/* Set Window not to show in the task bar */
|
/* Set Window not to show in the task bar */
|
||||||
SetWindowLong (hwndDlg, GWL_EXSTYLE,
|
SetWindowLongPtr(hwndDlg, GWL_EXSTYLE,
|
||||||
GetWindowLong (hwndDlg, GWL_EXSTYLE) & ~WS_EX_APPWINDOW );
|
GetWindowLongPtr(hwndDlg, GWL_EXSTYLE) & ~WS_EX_APPWINDOW );
|
||||||
|
|
||||||
/* Center dialog window in the screen. Not done for multi-monitor systems, where
|
/* 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
|
* 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);
|
if (hIconSmall) SendMessage (hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall);
|
||||||
|
|
||||||
/* Change style back to popup, already placed... */
|
/* 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,
|
SetWindowPos (hWnd, 0, 0, 0, 0, 0,
|
||||||
SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
|
SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
|
||||||
/* Make sure it gets the proper system menu for a WS_POPUP, too */
|
/* 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)
|
if (!hwnd || !hmenu)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (GetWindowLong (hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)
|
if (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)
|
||||||
dwExStyle = MF_BYCOMMAND | MF_CHECKED;
|
dwExStyle = MF_BYCOMMAND | MF_CHECKED;
|
||||||
else
|
else
|
||||||
dwExStyle = MF_BYCOMMAND | MF_UNCHECKED;
|
dwExStyle = MF_BYCOMMAND | MF_UNCHECKED;
|
||||||
|
@ -408,7 +408,7 @@ HandleCustomWM_COMMAND (unsigned long hwndIn,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Get extended window style */
|
/* Get extended window style */
|
||||||
dwExStyle = GetWindowLong (hwnd, GWL_EXSTYLE);
|
dwExStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
|
||||||
|
|
||||||
/* Handle topmost windows */
|
/* Handle topmost windows */
|
||||||
if (dwExStyle & WS_EX_TOPMOST)
|
if (dwExStyle & WS_EX_TOPMOST)
|
||||||
|
|
Loading…
Reference in New Issue