visual studio - Disable Maximize Button c++ console application -
i maintaining old c++ application running console. has disabled "close" buttun . need disable maximize button well. following code disabes close button
deletemenu(getsystemmenu(getconsolewindow(), false), sc_close, mf_bycommand); drawmenubar(getconsolewindow());
i have added line disable maximize button:
deletemenu(getsystemmenu(getconsolewindow(), false), sc_close, mf_bycommand); deletemenu(getsystemmenu(getconsolewindow(), false), sc_maximize, mf_bycommand); drawmenubar(getconsolewindow());
it works, button disabled not greyed out. (the close button greyed out) missing? thank you.
use setwindowlong
change window style, call setwindowpos
. example:
hwnd hwnd = getconsolewindow(); dword style = getwindowlong(hwnd, gwl_style); style &= ~ws_maximizebox; setwindowlong(hwnd, gwl_style, style); setwindowpos(hwnd, null, 0, 0, 0, 0, swp_nosize|swp_nomove|swp_framechanged);
Comments
Post a Comment