Hi,
Is it possible to add a menuitem to system menu?
Thanks,
Regards,
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.06
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.06
Hi,
Is it possible to add a menuitem to system menu?
Thanks,
procedure DisableX(ODLG)
local hMenu
hMenu := GetSystemMenu(oDlg:hWnd,.f.)
RemoveMenu( hMenu, 6, MF_BYPOSITION)
RemoveMenu( hMenu, 5, MF_BYPOSITION)
RemoveMenu( hMenu, 4, MF_BYPOSITION)
RemoveMenu( hMenu, 3, MF_BYPOSITION)
RemoveMenu( hMenu, 2, MF_BYPOSITION)
RemoveMenu( hMenu, 1, MF_BYPOSITION)
RemoveMenu( hMenu, 0, MF_BYPOSITION)
returnAppendMenu( <hMenu>, <nFlags>, <nFlags>, <cPrompt> ) --> lSuccesprocedure AddItemSystemMenu(ODLG, cPrompt, bRunProc)
local hMenu
hMenu := GetSystemMenu(oDlg:hWnd,.f.)
AppendMenu( hMenu, 0, ??, cPrompt)
returnHakan,
It looks from your code like you are trying to add it to a dialog, but dialogs don't have system menus.
Try the ON INIT clause of a window.
ACTIVATE WINDOW oWnd ON INIT...
I'm not sure I would recommend putting anything on the system menu. Most users will not look there, in fact most users don't even know there is a menu there. And I don't think I have ever seen anything but the default items on this menu in any app.
James
James Bott wrote:I'm not sure I would recommend putting anything on the system menu. Most users will not look there, in fact most users don't even know there is a menu there. And I don't think I have ever seen anything but the default items on this menu in any app.
James
FUNCTION addSys(oDlg)
local oMenu
REDEFINE SYSMENU oMenu OF oDlg
MENUITEM "Item 1" ACTION MsgInfo( "any action" )
MENUITEM "Item 2"
ENDMENU
return oMenu