That's MFC, not WinAPI...
#include <QtGui>
#ifdef Q_WS_WIN
#include <qt_windows.h>
#endif // Q_WS_WIN
int main(int argc, char *argv[])
{
#ifdef Q_WS_WIN
HMENU menu = ::GetSystemMenu(window.winId(), FALSE);
::DeleteMenu(menu, SC_CLOSE, MF_BYCOMMAND);
::EnableMenuItem(menu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
// or (removes the item in of system menu)
// ::DeleteMenu(menu, SC_CLOSE, MF_BYCOMMAND);
#endif // Q_WS_WIN
window.show();
return app.exec();
}
#include <QtGui>
#ifdef Q_WS_WIN
#include <qt_windows.h>
#endif // Q_WS_WIN
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget window;
#ifdef Q_WS_WIN
HMENU menu = ::GetSystemMenu(window.winId(), FALSE);
::DeleteMenu(menu, SC_CLOSE, MF_BYCOMMAND);
::EnableMenuItem(menu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
// or (removes the item in of system menu)
// ::DeleteMenu(menu, SC_CLOSE, MF_BYCOMMAND);
#endif // Q_WS_WIN
window.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks