B4J Question How obtain hWnd of first windows program launched from jShell

amorosik

Expert
Licensed User
I use JShell to start an external program, in this case AnyDesk
How to get the window handle of the program window started?
I'm trying to get that value because I would like to use the Windows SetWindowPos API to resize and position the AnyDesk window
 

Pendrush

Well-Known Member
Licensed User
Longtime User
Example app will find window by name, you can maximize window and also change window position and size, you can also use all other methods.
More info about possible methods HERE.
Download two jar from links below and copy them to AdditionalLibrary folder.
JNA and JNA Platform.
Tested on Windows 11.
 

Attachments

  • hWnd.zip
    2.3 KB · Views: 216
Last edited:
Upvote 0

amorosik

Expert
Licensed User
Thank you very much
But searching for a windows for its title may return the wrong windows
The title may be duplicated
For this I initially asked if from the jShell command it was possible to have information on the hWnd of the visible windows program started
 
Upvote 0
Top