Skip to content

Commit

Permalink
Added GetClientRect (#702)
Browse files Browse the repository at this point in the history
Added GetClientRect function to get the size of the Window excluding the borders.
  • Loading branch information
jonatino authored and matthiasblaesing committed Sep 11, 2016
1 parent 4c72be2 commit 84cc379
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Features
* [#667](https://github.com/java-native-access/jna/pull/667): Added NtSetSecurityObject and NtQuerySecurityObject to `com.sun.jna.platform.win32.NtDll` - [@amarcionek](https://github.com/amarcionek).
* [#680](https://github.com/java-native-access/jna/pull/680): Added `SetCurrentProcessExplicitAppUserModelID` and `GetCurrentProcessExplicitAppUserModelID` to `com.sun.jna.platform.win32.Shell32` for setting the [System.AppUserModel.ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569.aspx) of the host process - [@rednoah](https://github.com/rednoah).
* [#693](https://github.com/java-native-access/jna/pull/693): Bind DDEML (Dynamic Data Exchange Management Library), add a thread implementation that runs a windows message loop - [@matthiasblaesing](https://github.com/matthiasblaesing).
* [#702](https://github.com/java-native-access/jna/pull/702): Added `GetClientRect` to `com/sun/jna/platform/win32/User32` - [@Jonatino](https://github.com/Jonatino).

Bug Fixes
---------
Expand Down
23 changes: 21 additions & 2 deletions contrib/platform/src/com/sun/jna/platform/win32/User32.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,30 @@ public interface User32 extends StdCallLibrary, WinUser, WinNT {
* Long pointer to a RECT structure that receives the screen
* coordinates of the upper-left and lower-right corners of the
* window.
* @return Nonzero indicates success. Zero indicates failure. To get
* extended error information, call GetLastError.
* @return If the function succeeds, the return value is nonzero. If the
* function fails, the return value is zero.
*/
boolean GetWindowRect(HWND hWnd, RECT rect);

/**
* This function retrieves the coordinates of a window's client area.
* The client coordinates specify the upper-left and lower-right corners of the
* client area. Because client coordinates are relative to the upper-left
* corner of a window's client area, the coordinates of the upper-left corner
* are (0,0).
*
* @param hWnd
* Handle to the window.
* @param rect
* Long pointer to a RECT structure that structure that receives
* the client coordinates. The left and top members are zero. The
* right and bottom members contain the width and height of the
* window.
* @return If the function succeeds, the return value is nonzero. If the
* function fails, the return value is zero.
*/
boolean GetClientRect(HWND hWnd, RECT rect);

/**
* This function copies the text of the specified window's title bar - if it
* has one - into a buffer. If the specified window is a control, the text
Expand Down

0 comments on commit 84cc379

Please sign in to comment.