Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8094276

WinApi User32.sendMessage HWND_BROADCAST

    XMLWordPrintable

Details

    Description

      Original post on the forum: https://forums.oracle.com/forums/thread.jspa?messageID=10475613

      I will summarize the content of the topic above:

      *Problem:*

      3rd party software making use of the User32.sendMessage combined with the HWND_BROADCAST flag.

      *Result:*

      3rd party software "hangs" until you kill the JavaFX process.
      This behaviour can be explained by the misuse of the sendMessage method combined with the HWND_BROADCAST. Even Microsoft disapproves using this call together with this flag.

      *Expected behaviour:*

      JavaFX should "reply" or better "process" this message by replacing the WndProc method.
      I provided a way to do this using JNA and Swing (see original post on the forum) but unfortunately I was not able to find a way to do the same with a JavaFX window.

      *Replication Data:*

      You can reproduce the bug by downloading the attachments I provided.
      We use the following commandline to execute the fxdemo.jar, it is possible that you need to adjust the path to the jar files.

      java -cp ./fxdemo.jar;"../JavaFX 2.1/lib/javaws.jar";"../JavaFX 2.1/lib/jfxrt.jar";"../JavaFX 2.1/lib/plugin.jar";../. -Djava.library.path="../JavaFX 2.1/lib" javafxdemo.ColorfulCircles


      *Replication Logic to trigger hang:*

      1) Start the JavaFX Demo jar
      2) Open the Visual C# program
      2.1) enter a text and press the button
      2.2) you will see that the application will hang

      *Replication Logic to trigger good flow:*

      1) Close all JavaFX programs together with applications which are not needed to test
      2) Open Visual C# program
      2.1) enter a text and press the button
      2.2) you will see that the text will be posted as a Label on the program

      *Requests:*

      - Could you provide me a way to use JNA combined with a JavaFX window just like I did with the Swing JFrame? Refer to the code in the original msg on the forum. This way I can write a temp. workaround myself.

      *Additional Information:*

      Affected platforms : Windows XP, Vista and 7, probably all versions.
      Affected runtimes: JavaFX 2.0, 2.1, 2.2dev

      *Impossible paths: *

      It is illegal for us to adjust/patch the 3rd party software to work with eg. sendMessageTimeout.
      3rd party software vendors are not willing to adjust their code and release a new version.
      Clients refuse to uninstall the 3rd party software because they need it.

      Attachments

        Issue Links

          Activity

            People

              vadim Vadim Pakhnushev
              cmolemansjfx Carl Molemans (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: