Preventing Winform from being maximized?

前端 未结 9 1942
迷失自我
迷失自我 2020-12-06 18:02

I want to prevent my desktop application from being maximized. It should not become maximized by any means - by double clicking on title bar, or by clicking Windows + Up arr

9条回答
  •  清歌不尽
    2020-12-06 18:54

    You can try to RegisterHotKey Win+Up if your window or application is activated and unregister this hot key if it is deactivated. You must catch the hotkey and return appropriate value to prevent further processing.

    Look at WM_ACTIVATEAPP, WM_ACTIVATE and WM_NCACTIVATE. The first can be used if you want to disable the Win+UP for all your windows.

提交回复
热议问题