B4J Question All windows Titles

Discussion in 'B4J Questions' started by jroriz, Oct 27, 2018.

  1. jroriz

    jroriz Active Member Licensed User

    Hi.

    Is it possible to get all windows titles. All, not only from my application.
     
  2. stevel05

    stevel05 Expert Licensed User

    You can get them using JNA. Jar downloads are here https://github.com/java-native-access/jna, you need both the JNA and the JNA Platform jars. Scroll down to the downloads section

    Javadoc is here: http://java-native-access.github.io/jna/5.0.0/javadoc/

    Copy both of the jars to your additional libraries folder, include them in your project:

    Code:
    #AdditionalJar: jna-5.0.0
    #AdditionalJar: jna-platform-5.0.0
    And run the code :

    Code:
    Dim WU As JavaObject
        WU.InitializeStatic(
    "com.sun.jna.platform.WindowUtils")
        
    Dim L As List = WU.RunMethod("getAllWindows",Array(True)) ' or False if you want to include windows that are not visible
     
        
    For Each JO As JavaObject In L
            
    Log(JO.RunMethod("getTitle",Null))
        
    Next
     
    Last edited: Oct 28, 2018
    Cain Soft, inakigarm, jroriz and 3 others like this.
  3. jroriz

    jroriz Active Member Licensed User

    Like a charm...
    Thanks.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice