Klasse User32Util.MessageLoopThread

java.lang.Object
java.lang.Thread
com.sun.jna.platform.win32.User32Util.MessageLoopThread
Alle implementierten Schnittstellen:
Runnable
Umschließende Klasse:
User32Util

public static class User32Util.MessageLoopThread extends Thread
Helper class, that runs a windows message loop as a seperate thread. This is intended to be used in conjunction with APIs, that need a spinning message loop. One example for this are the DDE functions, that can only be used if a message loop is present. To enable interaction with the mainloop the MessageLoopThread allows to dispatch callables into the mainloop and let these Callables be invoked on the message thread. This implies, that the Callables should block the loop as short as possible.
  • Konstruktordetails

    • MessageLoopThread

      public MessageLoopThread()
  • Methodendetails

    • run

      public void run()
      Angegeben von:
      run in Schnittstelle Runnable
      Setzt außer Kraft:
      run in Klasse Thread
    • runAsync

      public <V> Future<V> runAsync(Callable<V> command)
    • runOnThread

      public <V> V runOnThread(Callable<V> callable) throws Exception
      Löst aus:
      Exception
    • exit

      public void exit()
    • getMessageFailed

      protected boolean getMessageFailed()
      The method is called from the thread, that run the message dispatcher, when the call to User32.GetMessage(com.sun.jna.platform.win32.WinUser.MSG, com.sun.jna.platform.win32.WinDef.HWND, int, int) fails (returns -1).

      If the method returns true, the MainLoop is exitted, if it returns false the mainloop is resumed.

      Default behavior: The error code is logged to the com.sun.jna.platform.win32.User32Util.MessageLoopThread logger and the main loop exists.

      Gibt zurück:
      true if MainLoop should exit, false it it should resume