Search Results

Search found 2 results on 1 pages for 'systemmenu'.

Page 1/1 | 1 

  • How to Disable the Move System Menu Item?

    - by Andreas Rejbrand
    In Microsoft Windows, this works: mnu := GetSystemMenu(h, false); EnableMenuItem(mnu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED); But this does not work: mnu := GetSystemMenu(h, false); EnableMenuItem(mnu, SC_MOVE, MF_BYCOMMAND or MF_GRAYED); Hence I know how to disable the "Close" system menu item of a window, but not the "Move" item. How do I do that? Update Of course one alternative to using the very nice function EnableMenuItem, is to use SetMenuItemInfo: FillChar(info, sizeOf(info), 0); with info do begin cbSize := sizeOf(info); fMask := MIIM_STATE; fState := MFS_GRAYED; end; SetMenuItemInfo(mnu, SC_MOVE, false, info); But this again works perfectly for SC_CLOSE, but not at all for SC_MOVE!

    Read the article

  • WM_SYSCOMMAND oddities

    - by Andreas Rejbrand
    An application recieves the WM_SYSCOMMAND message when the user selects a menu item command on the system menu, and so wParam can be SC_CLOSE, SC_CONTEXTHELP, SC_MAXIMIZE, SC_MINIMIZE, SC_RESTORE etc. That's logical. But one can also send the WM_SYSCOMMAND message to send commands to the Windows Shell. For instance, one can display the start menu (SC_TASKLIST), activate the screen saver (SC_SCREENSAVE), and turn off the monitor (SC_MONITORPOWER). This does not make sense, does it? What does this have to do with the application's system menu? This is more of a "system command", i.e. more of a completely other interpretation of the name "WM_SYSCOMMAND" of the message. It's like the message is used to send command requests to the system. Why is this message used for two seemingly entirely different things, and what thing does the name "SYSCOMMAND" refer to (command on the system menu, or command of the operating system)?

    Read the article

1