GUI with no 'close' and 'minimize' buttons
14 ビュー (過去 30 日間)
古いコメントを表示
I have made a GUI which displays 'Please wait ...' during a computation so it shouldn't be closed or minimized. How can I eliminate the entire bar to prevent unwanted closure or action? Thank you in advance. P.S. I did download WindowAPI but it's not working or I don't know to run it properly. A little help would be great.
0 件のコメント
回答 (3 件)
Sampath Rachumallu
2020 年 5 月 11 日
You can check the below link.
You can hide the 'minimise' and 'close' button by setting 'WindowState' property of uifigure to 'full screen'. Here is the code
f = uifigure('WindowState', 'fullscreen');
But when the 'ESC' key is pressed it will come to normal window size having all 'minimise', 'close' buttons etc
0 件のコメント
Friedrich
2014 年 5 月 12 日
編集済み: Friedrich
2014 年 5 月 19 日
Hi,
at least on Windows AFAIK no close button is only possible if you disable the complete caption of the window which results in no minimize and maximize buttons too. However no minimize button is possible but you have to stay with the close button. All of this can be done using the Windows API and the SetWindowLong function inside a MEX function.
It migth be easier to implement your own CloseRequestFcn to prevent closing the figure as long the calculation runs. However getting the minimize button to do nothing is not possible from within MATLAB.
UPDATE
Use a small mex (mymex.c):
#include "mex.h"
#include "windows.h"
void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
if (nrhs == 1)
{
long value = GetWindowLong(*(HWND*)mxGetData(prhs[0]), GWL_STYLE);
plhs[0] = mxCreateLogicalScalar(SetWindowLong(*(HWND*)mxGetData(prhs[0]),GWL_STYLE,(int)(value & ~WS_CAPTION)) > 0);
}
}
And call it from MATLAB
plot(1:10);
pause(1);
jFrame = get(handle(gcf),'JavaFrame');
hWnd = int32(jFrame.fHG1Client.getWindow.getHWnd);
mymex(hWnd)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!