About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

scripts default iconWindowAPI (Scripts) Publisher's description

WINDOWAPI - Set window properties using the Windows API

WINDOWAPI - Set window properties using the Windows API

There are a lot of functions in the FEX to set the figure properties, e.g. maximized, minimized, always-on-top, level of transparency (using Java).
This submission adds 4 new features:
1. Maximize a window with or without visible taskbar or menu bar.
2. Set transparency level of figure and stencil-color: pixels of a this color are 100% transparent.
3. Placing figures on multi-monitor setups.
4. Clip region: draw only pixles inside a specified rectangle (e.g. splash screen).

WindowAPI(FigH, Command)
FigH: Matlab's figure handle or Windows HWND.
TopMost: Window is topmost even if the focus is lost.
NoTopMost: Disable the topmost state.
Front: Move window on toptemporarily.
Minimize: Minimize the window.
Restore: Restore to former size.
Maximize: Full screen, taskbar and menubar visible.
XMax, YMax: Maximize figure horizontally or vertically only.
Position: Set inner figure position to 'work' (taskbar visible), 'full' (taskbar hidden),
or [X,Y,Width,Height].
Monitor index can be specified also.
OuterPosition: As Position, but with figure border and titlebar.
Flash: Short flashing.
Alpha: Set the figure's transparency between 0.0 and 1.0.
4th input [R,G,B]: Pixels with this color are 100% transparent in addition.
Opaque: Release memory needed for alpha blending.
Clip: Draw only pixels inside a rectangle.
ToScreen: Move figure completely to nearest monitor.
SetFocus: Gain keyboard focus to figure (figure(FigH) is buggy).

Reply = WindowAPI(FigureHandle, Command)
GetStatus: Replies 'maximized', 'minimized' or 'restored'.
GetHWnd: Reply the Windows handle of the figure.
Position/OuterPosition: If used with 2 inputs, the position relative to current monitor and the monitor index is replied.
Monitor: Get index and position of monitor.

This function calls Windows-API functions => No Linux, no MacOS - sorry.
The function is written in C and must be compiled before using by the mex command. See WindowAPI.c for instructions.
Suggestion for other OS are are very appreciated!

Maximize the current figure:
WindowAPI(gcf, 'maximize')
A semi-transparent figure with through-looking background:
FigH = figure('Color', ones(1,3));
WindowAPI(FigH, 'Alpha', 0.5, [255,255,255]);

Draw a button without surrounding figure ("spalsh button"):
FigH = figure;
ButtonH = uicontrol('Style', 'PushButton', 'String', 'Bye', ...
'Units', 'pixels', 'Callback', 'delete(gcbf)');
WindowAPI(FigH, 'Clip', get(ButtonH, 'Position'));

Tested: Matlab 6.5, 7.7, 7.8, WinXP, 32bit, MSVC 2008, LCC3.8, BCC5.5
Assumed compatibility: Higher Matlab versions, 64 bit.

System Requirements:

MATLAB 7.8 (R2009a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

WindowAPI (Scripts) Tags:

Click on a tag to find related softwares

Is WindowAPI (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.