mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 15:43:37 +00:00
Added implementation of GetWindowInfo.
This commit is contained in:
parent
2028110222
commit
ca30e48f71
|
@ -327,6 +327,7 @@ debug_channels (accel caret class clipboard combo comm cursor dc ddeml dialog
|
|||
@ stdcall GetWindowTextW(long ptr long) GetWindowTextW
|
||||
@ stdcall GetWindowThreadProcessId(long ptr) GetWindowThreadProcessId
|
||||
@ stdcall GetWindowWord(long long) GetWindowWord
|
||||
@ stdcall GetWindowInfo(long ptr) GetWindowInfo
|
||||
@ stdcall GrayStringA(long long ptr long long long long long long) GrayStringA
|
||||
@ stdcall GrayStringW(long long ptr long long long long long long) GrayStringW
|
||||
@ stdcall HideCaret(long) HideCaret
|
||||
|
|
|
@ -3483,6 +3483,23 @@ typedef HDEVNOTIFY *PHDEVNOTIFY;
|
|||
|
||||
#define DEVICE_NOTIFY_WINDOW_HANDLE 0x00000000
|
||||
|
||||
/* used for GetWindowInfo() */
|
||||
|
||||
#define WS_ACTIVECAPTION 0x0001
|
||||
|
||||
typedef struct tagWINDOWINFO {
|
||||
DWORD cbSize;
|
||||
RECT rcWindow;
|
||||
RECT rcClient;
|
||||
DWORD dwStyle;
|
||||
DWORD dwExStyle;
|
||||
DWORD dwWindowStatus;
|
||||
UINT cxWindowBorders;
|
||||
UINT cyWindowBorders;
|
||||
ATOM atomWindowType;
|
||||
WORD wCreatorVersion;
|
||||
} WINDOWINFO, *PWINDOWINFO, *LPWINDOWINFO;
|
||||
|
||||
#define EnumTaskWindows(handle,proc,lparam) \
|
||||
EnumThreadWindows(handle,proc,lparam)
|
||||
#define OemToAnsiA OemToCharA
|
||||
|
@ -3937,25 +3954,24 @@ BOOL WINAPI GetUserObjectInformationW(HANDLE,INT,LPVOID,DWORD,LPDWORD);
|
|||
#define GetUserObjectInformation WINELIB_NAME_AW(GetUserObjectInformation)
|
||||
HWND WINAPI GetWindow(HWND,UINT);
|
||||
HDC WINAPI GetWindowDC(HWND);
|
||||
BOOL WINAPI GetWindowInfo(HWND, PWINDOWINFO);
|
||||
LONG WINAPI GetWindowLongA(HWND,INT);
|
||||
LONG WINAPI GetWindowLongW(HWND,INT);
|
||||
#define GetWindowLong WINELIB_NAME_AW(GetWindowLong)
|
||||
BOOL WINAPI GetWindowPlacement(HWND,LPWINDOWPLACEMENT);
|
||||
BOOL WINAPI GetWindowRect(HWND,LPRECT);
|
||||
INT WINAPI GetWindowRgn(HWND,HRGN);
|
||||
BOOL WINAPI GetWindowPlacement(HWND,LPWINDOWPLACEMENT);
|
||||
BOOL WINAPI GetWindowRect(HWND,LPRECT);
|
||||
INT WINAPI GetWindowRgn(HWND,HRGN);
|
||||
HWINSTA WINAPI GetProcessWindowStation(void);
|
||||
#define GetWindowTask(hwnd) ((HTASK)GetWindowThreadProcessId(hwnd,NULL))
|
||||
INT WINAPI GetWindowTextA(HWND,LPSTR,INT);
|
||||
INT WINAPI GetWindowTextW(HWND,LPWSTR,INT);
|
||||
INT WINAPI GetWindowTextA(HWND,LPSTR,INT);
|
||||
INT WINAPI GetWindowTextW(HWND,LPWSTR,INT);
|
||||
#define GetWindowText WINELIB_NAME_AW(GetWindowText)
|
||||
INT WINAPI GetWindowTextLengthA(HWND);
|
||||
INT WINAPI GetWindowTextLengthW(HWND);
|
||||
INT WINAPI GetWindowTextLengthA(HWND);
|
||||
INT WINAPI GetWindowTextLengthW(HWND);
|
||||
#define GetWindowTextLength WINELIB_NAME_AW(GetWindowTextLength)
|
||||
WORD WINAPI GetWindowWord(HWND,INT);
|
||||
BOOL WINAPI GrayStringA(HDC,HBRUSH,GRAYSTRINGPROC,LPARAM,
|
||||
INT,INT,INT,INT,INT);
|
||||
BOOL WINAPI GrayStringW(HDC,HBRUSH,GRAYSTRINGPROC,LPARAM,
|
||||
INT,INT,INT,INT,INT);
|
||||
BOOL WINAPI GrayStringA(HDC,HBRUSH,GRAYSTRINGPROC,LPARAM,INT,INT,INT,INT,INT);
|
||||
BOOL WINAPI GrayStringW(HDC,HBRUSH,GRAYSTRINGPROC,LPARAM,INT,INT,INT,INT,INT);
|
||||
#define GrayString WINELIB_NAME_AW(GrayString)
|
||||
BOOL WINAPI HideCaret(HWND);
|
||||
BOOL WINAPI HiliteMenuItem(HWND,HMENU,UINT,UINT);
|
||||
|
|
|
@ -3340,3 +3340,55 @@ UINT WINAPI GetWindowModuleFileNameW( HWND hwnd, LPSTR lpszFileName, UINT cchFil
|
|||
hwnd, lpszFileName, cchFileNameMax);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* GetWindowInfo (USER32.@)
|
||||
* hwnd: in
|
||||
* pwi: out.
|
||||
* MS Documentation mentions that pwi->cbSize must be set to SIZEOF(WINDOWINFO)
|
||||
* this may be because this structure changed over time. If this is the
|
||||
* the case, then please: FIXME.
|
||||
* Using the structure described in MSDN for 98/ME/NT(4.0 SP3)/2000/XP.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
pwi->rcWindow = wndInfo->rectWindow;
|
||||
pwi->rcClient = wndInfo->rectClient;
|
||||
pwi->dwStyle = wndInfo->dwStyle;
|
||||
pwi->dwExStyle = wndInfo->dwExStyle;
|
||||
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->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 */
|
||||
|
||||
WIN_ReleasePtr(wndInfo);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue