Skip to content

Commit 95ac06a

Browse files
PAX523dblock
authored andcommitted
Added com.sun.jna.platform.WindowUtils.getAllWindows, getWindowIcon,
`getIconSize`, `getWindowTitle`, `getPRocessFilePath` and `getWindowLocationAndSize`. Request textual message of current last error code `com.sun.jna.platform.win32.Kernel32Util.getLastErrorMessage`. Added `com.sun.jna.platform.win32.GDI32.GetObject`. Added `com.sun.jna.platform.win32.Psapi` with `GetModuleFileNameEx`- [@PAX523](https://github.com/PAX523). Added `com.sun.jna.platform.win32.User32.GetIconInfo`, `SendMessageTimeout`, `GetClassLongPtr`. Added `com.sun.jna.platform.win32.WinGDI.ICONINFO` and `BITMAP`. Added process-specific access rights constants in `com.sun.jna.platform.win32.WinNT`. Added specific constants for request of icon settings in `com.sun.jna.platform.win32.WinUser`. Added constants for `GetClassLong`, `SendMessageTimeout` and `GetIconInfo` in `com.sun.jna.platform.win32.WinUser`.
1 parent e94f781 commit 95ac06a

16 files changed

+1594
-35
lines changed

CHANGES.md

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ Features
2828
* [#368](https://github.com/twall/jna/pull/368): Added `com.sun.jna.platform.win32.Kernel32.VirtualQueryEx`, `com.sun.jna.platform.win32.WinNT.MEMORY_BASIC_INFORMATION` and `MEM_COMMIT`, `MEM_FREE`, `MEM_RESERVE`, `MEM_IMAGE`, `MEM_MAPPED`, `MEM_PRIVATE` constants to `com.sun.jna.platform.win32.WinNT` - [@apsk](https://github.com/apsk).
2929
* Allow interoperation with JNI revision changes - [@twall](https://github.com/twall).
3030
* [#391](https://github.com/twall/jna/pull/391): Added `EncryptFile`, `DecryptFile`, `FileEncryptionStatus`, `EncryptionDisable`, `OpenEncryptedFileRaw`, `ReadEncryptedFileRaw`, `WriteEncryptedFileRaw`, and `CloseEncryptedFileRaw` to `com.sun.jna.platform.win32.Advapi32` with related `Advapi32Util` helpers - [@khalidq](https://github.com/khalidq).
31+
32+
* [#400](https://github.com/twall/jna/pull/400): Added `com.sun.jna.platform.WindowUtils.getAllWindows`, `getWindowIcon`, `getIconSize`, `getWindowTitle`, `getPRocessFilePath` and `getWindowLocationAndSize` - [@PAX523](https://github.com/PAX523).
33+
* [#400](https://github.com/twall/jna/pull/400): Request textual message of current last error code `com.sun.jna.platform.win32.Kernel32Util.getLastErrorMessage` - [@PAX523](https://github.com/PAX523).
34+
* [#400](https://github.com/twall/jna/pull/400): Added `com.sun.jna.platform.win32.GDI32.GetObject` - [@PAX523](https://github.com/PAX523).
35+
* [#400](https://github.com/twall/jna/pull/400): Added `com.sun.jna.platform.win32.Psapi` with `GetModuleFileNameEx`- [@PAX523](https://github.com/PAX523).
36+
* [#400](https://github.com/twall/jna/pull/400): Added `com.sun.jna.platform.win32.User32.GetIconInfo`, `SendMessageTimeout`, `GetClassLongPtr` - [@PAX523](https://github.com/PAX523).
37+
* [#400](https://github.com/twall/jna/pull/400): Added `com.sun.jna.platform.win32.WinGDI.ICONINFO` and `BITMAP` - [@PAX523](https://github.com/PAX523).
38+
* [#400](https://github.com/twall/jna/pull/400): Added process-specific access rights constants in `com.sun.jna.platform.win32.WinNT` - [@PAX523](https://github.com/PAX523).
39+
* [#400](https://github.com/twall/jna/pull/400): Added specific constants for request of icon settings in `com.sun.jna.platform.win32.WinUser` - [@PAX523](https://github.com/PAX523).
40+
* [#400](https://github.com/twall/jna/pull/400): Added constants for `GetClassLong`, `SendMessageTimeout` and `GetIconInfo` in `com.sun.jna.platform.win32.WinUser` - [@PAX523](https://github.com/PAX523).
3141

3242
Bug Fixes
3343
---------
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Copyright (c) 2015 Andreas "PAX" L\u00FCck, All Rights Reserved
3+
*
4+
* This library is free software; you can
5+
* redistribute it and/or modify it under the terms of the GNU Lesser
6+
* General Public License as published by the Free Software Foundation;
7+
* either version 2.1 of the License, or (at your option) any later
8+
* version. <p/> This library is distributed in the hope that it will be
9+
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
10+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+
* Lesser General Public License for more details.
12+
*/
13+
package com.sun.jna.platform;
14+
15+
import java.awt.Rectangle;
16+
17+
import com.sun.jna.platform.win32.WinDef.HWND;
18+
19+
/**
20+
* Holds some general information about a window.
21+
*
22+
* @author Andreas "PAX" L&uuml;ck, onkelpax-git[at]yahoo.de
23+
*/
24+
public class DesktopWindow {
25+
private HWND hwnd;
26+
private String title;
27+
private String filePath;
28+
private Rectangle locAndSize;
29+
30+
/**
31+
* @param hwnd
32+
* The associated window handle for this window.
33+
* @param title
34+
* The title text of the window.
35+
* @param filePath
36+
* The full file path to the main process that created the
37+
* window.
38+
* @param locAndSize
39+
* The window's location on screen and its dimensions.
40+
*/
41+
public DesktopWindow(final HWND hwnd, final String title,
42+
final String filePath, final Rectangle locAndSize) {
43+
this.hwnd = hwnd;
44+
this.title = title;
45+
this.filePath = filePath;
46+
this.locAndSize = locAndSize;
47+
}
48+
49+
/**
50+
* @return The associated window handle for this window.
51+
*/
52+
public HWND getHWND() {
53+
return hwnd;
54+
}
55+
56+
/**
57+
* @return The title text of the window.
58+
*/
59+
public String getTitle() {
60+
return title;
61+
}
62+
63+
/**
64+
* @return The full file path to the main process that created the window.
65+
*/
66+
public String getFilePath() {
67+
return filePath;
68+
}
69+
70+
/**
71+
* @return The window's location on screen and its dimensions.
72+
*/
73+
public Rectangle getLocAndSize() {
74+
return locAndSize;
75+
}
76+
}

0 commit comments

Comments
 (0)