|
| 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ü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