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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -