winapi - Handle external windows using java -
winapi - Handle external windows using java -
i need check if external window (another java program, not controlled programme i'm working on) open using title, , if open, either maximize or minimize based on user command in java (i know title of window , nil else) . google says can utilize winapi
window handle , manipulate using handle, i'm not able find how this.
i find references on how using jni here: in java swing how win32 window handle (hwnd) reference window?. possible without using jni?
could help me understand how this.
thanks , regards
i've added lot of win32 related window functions jna. can see details here.
// find , minimize window: windef.hwnd hwnd = user32.instance.findwindow("classname", "windowname"); user32.instance.showwindow(hwnd, winuser.sw_minimize);
you can enumerate 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; homecoming false; } homecoming true; } }, pointer.null); // minimize or maximize windowhandle[0] here...
java winapi
Comments
Post a Comment