Hi - I have a problem with JMP windows opening behind other (non-JMP) applications when I'm running an add-in of mine. The following sequence of steps demonstrates the problem as it occurs on my laptop:
- I open JMP, and I also open a JMP data set.
- I now open some other application (e.g. PowerPoint) and maximize it (so neither the JMP Home Window nor the window containing the data set are immediately visible).
- I do something in PowerPoint (e.g. edit a slide or whatever) but then I want to return to my analysis in JMP. So leaving PowerPoint open and maximized, I hover my mouse over the JMP icon at the bottom of the screen, and I select the window containing the data set I want to analyze. This window now sits on top of PowerPoint (although the JMP Home Window is still hidden behind PowerPoint).
- I now want to run my add-in, so I select it from the menu at the top of the data set window. The first thing my add-in does is to present a modal dialog window, inviting me to select the columns of my data table that I want to analyze, after which I just click on the "OK" button to proceed. When I call the add-in, the modal dialog window does indeed appear... but both it and the window containing the data set immediately disappear behind PowerPoint (giving the impression to the user that the application has just crashed).
I note that if instead of opening the add-in from the data set window, I bring the JMP Home Window to the front first, and then run the add-in from either window, the problem doesn't occur (or to be strictly accurate, the data window still disappears behind PowerPoint, but the modal dialog window remains on top - and the results of the analysis subsequently appear on top also).
I'm thinking that the solution might be to insert a one-line start-up script into the add-in which makes the JMP Home Window the current window (i.e. moving it in front of any other applications that happen to be open) before starting the analysis, but I note that the Get Window List function doesn't include the JMP Home Window within the list - so I can't reference it that way.
Can anybody suggest how I can resolve this? (I could of course just tell all the users not to use the add-in in the way described above, but I'd much prefer to prevent the problem from occurring via scripting if at all possible.)
Many thanks.