FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to reactivate a Item after using RemoveMenu(.. ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
How to reactivate a Item after using RemoveMenu(.. ?
Posted: Thu Nov 28, 2013 11:51 PM
Hello,

is it possible to reactivate a menu-item after
it is disabled using RemoveMenu( ... ?

The system-exit-button is disabled using :

hMenu := GetSystemMenu( oWinDlg:hWnd, .F. )
nCount := GetMItemCount( hMenu )

RemoveMenu( hMenu, nCount-1, nOR( 1024 ) )


how to activate X again at runtime ( ON / OFF ) ?



the function ( still something missing ? )
calling the function with lDisableX = .F., doesn't work :

Code (fw): Select all Collapse
FUNCTION DISABLEX( oWinDlg, lDisableX )
LOCAL nCount := 0, hMenu := 0
LOCAL cClass := oWinDlg:ClassName()

hMenu := GetSystemMenu( oWinDlg:hWnd, .F. )
nCount := GetMItemCount( hMenu )

IF lDisableX
    // To Disable `X' Button of a Window or a Dialog
    RemoveMenu( hMenu, nCount-1, nOR( 1024 ) )
ENDIF

DrawMenuBar( oWinDlg:hWnd )

RETURN NIL


best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion