<p>In a Java application (JRE 1.5.0_12) on Windows XP, I call a native method:</p>

<pre><code>public native int attachImage( ... );
</code></pre>

<p>... which lives in a Visual C++ 6.0 .dll. It displays an application-modal window. Problem is, the application's tray icon doesn't respond to mouseclicks while this window has focus. This is an issue because when this window is displayed, users often switch to another application to select the image to attach, then want to restore this application.</p>

What GUI package are you using?
You should be able to implement this without resorting to JNI calls.
For instance, in SWT, you can open an application modal shell like this:
```
```
Shell shell = new Shell(display,SWT.APPLICATION_MODAL);
```
```
For swing, this would be:
```
```
dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
```
```