From 6756a5f8ee77cf9c77e99bd3b50857df9e41c058 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 23 Nov 2007 02:03:15 +0000 Subject: [PATCH] return int from wxGetWindowId(), not WORD, to ensure comparing it with wxWindowID elsewhere works correctly even for negative ids git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50181 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/private.h | 2 +- src/msw/mdi.cpp | 4 ++-- src/msw/utilsgui.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index da4b7e83ca..f31355f2cb 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -866,7 +866,7 @@ extern WXDLLEXPORT wxString wxGetWindowClass(WXHWND hWnd); // get the window id (should be unsigned, hence this is not wxWindowID which // is, for mainly historical reasons, signed) -extern WXDLLEXPORT WXWORD wxGetWindowId(WXHWND hWnd); +extern WXDLLEXPORT int wxGetWindowId(WXHWND hWnd); // check if hWnd's WNDPROC is wndProc. Return true if yes, false if they are // different diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 7114765e93..774ee9b4a3 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -601,8 +601,8 @@ bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd) wxWindow *child = node->GetData(); if ( child->GetHWND() ) { - long childId = wxGetWindowId(child->GetHWND()); - if (childId == (long)id) + int childId = wxGetWindowId(child->GetHWND()); + if ( childId == (signed short)id ) { ::SendMessage( GetWinHwnd(GetClientWindow()), WM_MDIACTIVATE, diff --git a/src/msw/utilsgui.cpp b/src/msw/utilsgui.cpp index f01babae85..e3c65df081 100644 --- a/src/msw/utilsgui.cpp +++ b/src/msw/utilsgui.cpp @@ -293,9 +293,9 @@ wxString WXDLLEXPORT wxGetWindowClass(WXHWND hWnd) return str; } -WXWORD WXDLLEXPORT wxGetWindowId(WXHWND hWnd) +int WXDLLEXPORT wxGetWindowId(WXHWND hWnd) { - return (WXWORD)GetWindowLong((HWND)hWnd, GWL_ID); + return ::GetWindowLong((HWND)hWnd, GWL_ID); } // ---------------------------------------------------------------------------- -- 2.45.2