in Education by
I need to check if an external window (another java program, but not controlled by the program that I'm working on) is open using the title, and if it open, then either maximize or minimize it based on the user command in Java (I know only the title of the window and nothing else) . Google only says that I can use winapi to get the window handle and manipulate it using the handle, but I'm not able to find how to do this. I could find references on how to do it using JNI here: In Java Swing how do you get a Win32 window handle (hwnd) reference to a window?. Is it possible to do this without using JNI? Could someone help me understand how to do this. Thanks and Regards JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I've just added a lot of win32 related window functions into JNA. You can see the details here. // Find and minimize a window: WinDef.HWND hWnd = User32.INSTANCE.FindWindow("className", "windowName"); User32.INSTANCE.ShowWindow(hWnd, WinUser.SW_MINIMIZE); You can also enumerate all windows: final WinDef.HWND[] windowHandle = new WinDef.HWND[1]; User32.INSTANCE.EnumWindows(new WinUser.WNDENUMPROC() { @Override public boolean callback(WinDef.HWND hwnd, Pointer pointer) { if (matches(hwnd)) { windowHandle[0] = hwnd; return false; } return true; } }, Pointer.NULL); // Minimize or maximize windowHandle[0] here...

Related questions

0 votes
    Which of these interface handle sequences? (a) Set (b) List (c) Comparator (d) Collection The question ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these keywords must be used to handle the exception thrown by try block in some rational manner? (a ... Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of the following keyword is used by calling function to handle exception thrown by called function? (a) ... Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these keywords are used for the block to handle the exceptions generated by try block? (a) try ... Exception Handling of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    I'm trying to setup a guacamole instance to manage my servers accounts. It's working well when I' ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Basically i have a java String which i want to restrict all the characters other than this regex code ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    Which of the following matches nonword character using regular expression in java? (a) \w (b) \W (c) \ ... Regular Expressions of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of the following matches end of the string using regular expression in java? (a) \z (b) \\ (c ... Regular Expressions of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which feature of java 8 enables us to create a work stealing thread pool using all available processors at ... Miscellaneous of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    How to read entire file in one line using java 8? (a) Files.readAllLines() (b) Files.read() (c) ... Autoboxing & Miscellaneous of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of the following is advantage of using PreparedStatement in Java? (a) Slow performance (b) Encourages SQL ... JDBC of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    I use Selenium RC, for which the scroll command is selenium.getEval("scrollBy(0, 250)"); Now, I have started ... the command for it? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    I have created a set of multi-platform C++ components to load and manage various types of digitally signed ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Let's say, I have a folder called maps and inside maps I have map1.txt, map2.txt, and map3.txt. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    We have a library where users can pass in dates in multiple formats. They follow the ISO but are ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
...