Make GetWindowInfo() work for all windows and return correct values
Dmitry Timoshkov
dmitry at baikal.ru
Sat Aug 2 09:50:13 CDT 2003
Hello,
Changelog:
Dmitry Timoshkov <dmitry at codeweavers.com>
Make GetWindowInfo() work for all windows and return correct values.
--- cvs/hq/wine/windows/win.c Wed Jun 25 15:59:24 2003
+++ wine/windows/win.c Sat Aug 2 21:05:00 2003
@@ -3238,42 +3238,28 @@ UINT WINAPI GetWindowModuleFileNameW( HW
*/
BOOL WINAPI GetWindowInfo( HWND hwnd, PWINDOWINFO pwi)
{
- WND *wndInfo = NULL;
if (!pwi) return FALSE;
if (pwi->cbSize != sizeof(WINDOWINFO))
{
FIXME("windowinfo->cbSize != sizeof(WINDOWINFO). Please report\n");
return FALSE;
}
- wndInfo = WIN_GetPtr(hwnd);
- if (!wndInfo) return FALSE;
- if (wndInfo == WND_OTHER_PROCESS)
- {
- FIXME("window belong to other process\n");
- return FALSE;
- }
+ if (!IsWindow(hwnd)) return FALSE;
+
+ GetWindowRect(hwnd, &pwi->rcWindow);
+ GetClientRect(hwnd, &pwi->rcClient);
+ /* translate to screen coordinates */
+ MapWindowPoints(hwnd, 0, (LPPOINT)&pwi->rcClient, 2);
- pwi->rcWindow = wndInfo->rectWindow;
- pwi->rcClient = wndInfo->rectClient;
- pwi->dwStyle = wndInfo->dwStyle;
- pwi->dwExStyle = wndInfo->dwExStyle;
+ pwi->dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
+ pwi->dwExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE);
pwi->dwWindowStatus = ((GetActiveWindow() == hwnd) ? WS_ACTIVECAPTION : 0);
- /* if active WS_ACTIVECAPTION, else 0 */
- pwi->cxWindowBorders = ((wndInfo->dwStyle & WS_BORDER) ?
- GetSystemMetrics(SM_CXBORDER) : 0);
- pwi->cyWindowBorders = ((wndInfo->dwStyle & WS_BORDER) ?
- GetSystemMetrics(SM_CYBORDER) : 0);
- /* above two: I'm presuming that borders widths are the same
- * for each window - so long as its actually using a border.. */
+ pwi->cxWindowBorders = pwi->rcClient.left - pwi->rcWindow.left;
+ pwi->cyWindowBorders = pwi->rcWindow.bottom - pwi->rcClient.bottom;
- pwi->atomWindowType = GetClassLongA( hwnd, GCW_ATOM );
- pwi->wCreatorVersion = GetVersion();
- /* Docs say this should be the version that
- * CREATED the window. But eh?.. Isn't that just the
- * version we are running.. Unless ofcourse its some wacky
- * RPC stuff or something */
+ pwi->atomWindowType = GetClassLongW( hwnd, GCW_ATOM );
+ pwi->wCreatorVersion = 0x0400;
- WIN_ReleasePtr(wndInfo);
return TRUE;
}
More information about the wine-patches
mailing list