From: H.G. Muller Date: Fri, 4 Feb 2011 09:22:29 +0000 (+0100) Subject: Fix 64-bit Windows compilability X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=bb9df81fd2e6eb72f968308cab940535936279fe;p=xboard.git Fix 64-bit Windows compilability The API interface for Set/GetWindowLong has been changed for 64-bit Windows, both in the name of the call as in the arguments. --- diff --git a/winboard/wchat.c b/winboard/wchat.c index 97c060b..835f494 100644 --- a/winboard/wchat.c +++ b/winboard/wchat.c @@ -221,7 +221,7 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam SendMessage(hMemo, EM_SETEVENTMASK, 0, wMask | ENM_LINK); SendMessage(hMemo, EM_AUTOURLDETECT, TRUE, 0L); chatInputWindowProc = (WNDPROC) // cloned from ConsoleWndProc(). Assume they all share same proc. - SetWindowLong(GetDlgItem(hDlg, OPT_ChatInput), GWL_WNDPROC, (LONG) InterceptArrowKeys); + SetWindowLongPtr(GetDlgItem(hDlg, OPT_ChatInput), GWLP_WNDPROC, (LONG_PTR) InterceptArrowKeys); return FALSE; case WM_NOTIFY: diff --git a/winboard/winboard.c b/winboard/winboard.c index f27a1e6..08284bc 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -2223,7 +2223,7 @@ InitDrawingSizes(BoardSize boardSize, int flags) } if (tinyLayout != oldTinyLayout) { - long style = GetWindowLong(hwndMain, GWL_STYLE); + long style = GetWindowLongPtr(hwndMain, GWL_STYLE); if (tinyLayout) { style &= ~WS_SYSMENU; InsertMenu(hmenu, IDM_Exit, MF_BYCOMMAND, IDM_Minimize, @@ -2232,7 +2232,7 @@ InitDrawingSizes(BoardSize boardSize, int flags) style |= WS_SYSMENU; RemoveMenu(hmenu, IDM_Minimize, MF_BYCOMMAND); } - SetWindowLong(hwndMain, GWL_STYLE, style); + SetWindowLongPtr(hwndMain, GWL_STYLE, style); for (i=0; menuBarText[tinyLayout][i]; i++) { ModifyMenu(hmenu, i, MF_STRING|MF_BYPOSITION|MF_POPUP, @@ -2381,7 +2381,7 @@ InitDrawingSizes(BoardSize boardSize, int flags) boardRect.right - BUTTON_WIDTH*(N_BUTTONS-i), messageRect.top, BUTTON_WIDTH, messageSize.cy, hwndMain, (HMENU) buttonDesc[i].id, - (HINSTANCE) GetWindowLong(hwndMain, GWL_HINSTANCE), NULL); + (HINSTANCE) GetWindowLongPtr(hwndMain, GWLP_HINSTANCE), NULL); if (tinyLayout) { SendMessage(buttonDesc[i].hwnd, WM_SETFONT, (WPARAM)font[boardSize][MESSAGE_FONT]->hf, @@ -2390,7 +2390,7 @@ InitDrawingSizes(BoardSize boardSize, int flags) if (buttonDesc[i].id == IDM_Pause) hwndPause = buttonDesc[i].hwnd; buttonDesc[i].wndproc = (WNDPROC) - SetWindowLong(buttonDesc[i].hwnd, GWL_WNDPROC, (LONG) ButtonProc); + SetWindowLongPtr(buttonDesc[i].hwnd, GWLP_WNDPROC, (LONG_PTR) ButtonProc); } } if (gridPen != NULL) DeleteObject(gridPen); @@ -4240,7 +4240,7 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK ButtonProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { - int id = GetWindowLong(hwnd, GWL_ID); + int id = GetWindowLongPtr(hwnd, GWLP_ID); int i, dir; for (i=0; i