My first attempt at a mex file making a simple call to the "SetWindowPos" function in the user32 library. This allows users to keep MATLAB figures on top, floating above all other windows even when focus is not on the target window.
Tested on MATLAB Version 22.214.171.1245 (R14) Service Pack 2 running under Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 2)
Great way to make windows always visible! I wish this was built into core MATLAB and available on other platforms too.
I've created a small patch to the file that allows to use other window names than "Figure X", i.e. for GUIDE windows or named figures. The original Author might want to incorporate it into his version:
Tried the example given above in:
MATLAB Version 126.96.36.1992 (R2007b) windows XP and got:
??? Error using ==> winontop
First input argument must be a figure handle
21 Nov 2007
Would be nice to see a multiplatform version.
As a matter of fact, they should include a stay on top command as figure property directly.
09 Jun 2006
Very useful, thanks a lot.
17 Mar 2006
Very useful. Could be even better if it could handle non-standard figure names. I was trying to use it with a custom gui with the figure name 'review', and it didn't work until I changed the name to 'Figure 1'
11 Dec 2005
Very nice. The only thing that seems a bit confusing is the arguement 'figure 1', and i'm not sure why it was not made to just be an integer. The following apparently works:
hf = figure;