Code covered by the BSD License  

Highlights from
CmdWinTool

5.0

5.0 | 1 rating Rate this file 10 Downloads (last 30 days) File Size: 9.6 KB File ID: #32005
image thumbnail

CmdWinTool

by Jan Simon

 

29 Jun 2011 (Updated 01 Nov 2011)

Programmatic control of the command window

| Watch this File

File Information
Description

Programmatic control of the the command window

On a netbook with a tiny monitor, the toolbar and the statusbar of Matlab's
command window occupy valuable space. The function CmdWinTool uses
undocumented Java methods to hide these UI elements.
But the interface allows much more:

Reply = CmdWinTool(Command, Data)
INPUT:
  Command as string:
  lean, fat: Hide or show toolbar and statusbar
  title: Set and get the window title
  statusText: String in the statusbar at the bottom
  toFront, toBack: Window before of behind other windows.
  hide, show: Hide or show the window
  JPosition: Set/get position relative to virtual screen, java conventions
  Position: Set/get position relative to monitor (*), Matlab conventions
  maximize, minimize, restore: guess...
  xmax, ymax: maximize horizontally/vertically only (*)
  toScreen: Move completely to nearest monitor (*)
  getHWnd: Get OS handle of the window (Windows only?)
  setFocus: Gain keyboard focus (*)
  getText: Get text written to window.
  top: Set AlwaysOnTop property
  font: Set and get font name and size
  background, foreground: Set and get font and background color.

The commands marked with (*) run under Windows only and need WindowAPI:
  http://www.mathworks.com/matlabcentral/fileexchange/31437
The other commands should run under MacOS and Linux also.
Tested: Matlab 6.5, 2008b, 2009a, 2011b, WinXP, Win7, multi-monitors
Run uTest_CmdWinTool to check compatibility on your platform.
I'd appreciate bugreports and suggestions for improvements.

This function is inspired by Yair Altman's excellent investigations in the
secrets of Matlab. See http://www.undocumentedmatlab.com

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
WindowAPI

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
21 Sep 2011 mohammad

So nice
thanks

Please login to add a comment or rating.
Updates
01 Nov 2011

Additional features: Font, ForeGround, BackGround.
Set and Get methods are joined: The current value is replied, if an output is used.

Tag Activity for this File
Tag Applied By Date/Time
command window Jan Simon 29 Jun 2011 15:58:24
maximize Jan Simon 29 Jun 2011 15:58:24
minimize Jan Simon 29 Jun 2011 15:58:24
statusbar Jan Simon 29 Jun 2011 15:58:24
menubar Jan Simon 29 Jun 2011 15:58:24
multimonitor Jan Simon 29 Jun 2011 15:58:24
control Jan Simon 29 Jun 2011 15:58:24

Contact us at files@mathworks.com