title: Java Access Bridge C#: Only MouseClicked event firing?
body: <p>I've been messing around with the Java Access Bridge and have managed to get most of it working, with one exception: I can only hook the MouseClicked event within the Java window.</p>
  
  <p>This code:</p>
  
  <pre><code>[DllImport("WindowsAccessBridge.dll", CallingConvention = CallingConvention.Cdecl)]
  private extern static void setMouseClickedFP(MouseClickedDelegate fp);
  
  [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  delegate void MouseClickedDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
  
  static MouseClickedDelegate mcd;
  mcd = new MouseClickedDelegate(HandleMouseClicked);
  
  static void HandleMouseClicked(System.Int32 vmID, IntPtr jevent, IntPtr ac)
  {
      getVersionInfo(vmID, out vi);
      releaseJavaObject(vmID, ac);
      releaseJavaObject(vmID, jevent);
  }
  </code></pre>
  
  <p>works without a problem. Whenever the Java window receives a MouseClick, the code that handles it triggers as well - fantastic. However, when I try and hook another event, I get nothing. No matter what the event, I'm not receiving anything. Here's an example:</p>
  
  <pre><code>[DllImport("WindowsAccessBridge.dll", CallingConvention = CallingConvention.Cdecl)]
  private extern static void setFocusGainedFP(FocusGainedDelegate fp);
  
  [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  delegate void FocusGainedDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
  
  static FocusGainedDelegate fgd;
  fgd = new FocusGainedDelegate(HandleFocusGained);
  
  static void HandleFocusGained(System.Int32 vmID, IntPtr jevent, IntPtr ac)
  {
      AccessibleContextInfo aci = new AccessibleContextInfo();
      getAccessibleContextInfo(vmID, ac, out aci);
  }
  </code></pre>
  
  <p>The above code does not get triggered, even though according to the oracle documentation, source, and examples, the calling convention and variable types are identical in both. </p>
  
  <p>I haven't been able to figure anything out, and I've attempted to use many, many of the events provided in the <a href="http://download.oracle.com/javase/accessbridge/2.0.2/api.htm#jab-api-calls" rel="nofollow noreferrer">documentation</a> and nothing is working. I'm at my wits end - even a general idea as to what's happening would help.</p>
  
  <p>NB: If it's a specific method required for each event type, the ones I'm looking to use are PropertyValueChangeFP, PropertySelectionChangeFP, PropertyTextChangeFP.</p>