Well.. in my searching trying to do more with Windows app's and B4X - i want to get the Foreground Window's Position, Size (for start)
And because it is not good start over and over new thread for the same thing - let's make it as default place for all methods have relationship if needed...
Where am i wrong ?
I am getting that:
SOLVED specific that - at this post by stevel05
Have in mind trying to do all that with OpenJDK.. Thanks for help !
And because it is not good start over and over new thread for the same thing - let's make it as default place for all methods have relationship if needed...
B4X:
Sub Process_Globals
Type rect(Bottom As Int,Left As Int,Right As Int,Top As Int)
...
Dim user32 As JavaObject
user32 = user32.InitializeStatic("com.sun.jna.platform.win32.User32").GetField("INSTANCE")
Dim hwnd1 As JavaObject = user32.RunMethod("GetForegroundWindow",Null)
Dim arect As rect
user32.runmethod("GetWindowRect",Array(hwnd1,arect))
Dim title(512) As Char
user32.RunMethod("GetWindowText", Array(hwnd1,title,512))
Dim native As JavaObject
Dim activewindowtitle As String = native.InitializeStatic("com.sun.jna.Native").RunMethod("toString", Array(title))
activewindowtitle = activewindowtitle.Trim
Log(activewindowtitle)
Log(arect.Left)
Where am i wrong ?
I am getting that:
java.lang.RuntimeException: Method: GetWindowRect not matched.
SOLVED specific that - at this post by stevel05
Have in mind trying to do all that with OpenJDK.. Thanks for help !
Last edited: