title: how to map callback Function with Java native access (JNA)
body: <p>How can i set up windows hook with <code>WH_FOREGROUNDIDLE</code> and the following call back Functions </p>
  
  <pre><code>DWORD CALLBACK ForegroundIdleProc( __in int code, DWORD wParam, LONG lParam );
  </code></pre>
  
  <p>I am trying to detect when a thread/process goes idle.</p>
  
  <p>I have obtained the <code>threadProccessId</code> by using the following functions:</p>
  
  <pre><code>GetForegroundWindow -&gt; GetWindowThreadProcessId.
  </code></pre>