Heres the utility i added to my security application.

Code:
'=================================================================================================================='
'                                                                                                                  '
'  PopupBlock.Bas Popup menu option selective blocking.    By: Elias Montoya                                       '
'  Thanx to Peter Jinks                                                                                            '
'                                                                                                                  '
'  Tested with PB 8.04                                                                                             '
'                                                                                                                  '
'  Public domain source code.                                                                                      '
'                                                                                                Jan 10 2009.      '
'==================================================================================================================
#COMPILE EXE
#DIM ALL
#INCLUDE "WIN32API.INC"
'==================================================================================================================
TYPE BlockData
 Active   AS LONG
 hStrings AS STRING * 2048
END TYPE

GLOBAL CYI  AS BLOCKDATA
'==================================================================================================================
FUNCTION WinEventFunc(BYVAL HookHandle AS LONG, BYVAL LEvent AS LONG, BYVAL hWnd AS LONG, BYVAL idObject AS LONG, BYVAL idChild AS LONG, BYVAL idEventThread AS LONG, BYVAL dwmsEventTime AS LONG) AS LONG

   LOCAL hmenu AS LONG
   LOCAL Index AS LONG
   LOCAL nMax  AS LONG
   LOCAL szString AS ASCIIZ * 256
   LOCAL TM AS STRING
   STATIC hMemory AS DWORD
   LOCAL CYI AS BLOCKDATA PTR
   LOCAL Itm AS LONG

   IF ISFALSE(hMemory) THEN
        hMemory = SendMessage(FindWindow(BYVAL %Null, "Popup Options blocker"), 19923, 2991, 3909)
   END IF

   IF ISFALSE(hMemory) THEN EXIT FUNCTION

   CYI = hMemory

   IF ISFALSE(@CYI.Active) THEN EXIT FUNCTION

   LOCAL TS AS STRING
   TS = TRIM$(@CYI.hStrings, ANY CHR$(0,32))

   IF ISFALSE(LEN(TS)) THEN EXIT FUNCTION
   
   DIM KW(1 TO PARSECOUNT(TS, ",")) AS LOCAL STRING
   PARSE TS, KW(), ","

   hMenu = SendMessage(hWnd, &h01E1, 0,0)

   IF ISFALSE(IsMenu(hMenu)) THEN EXIT FUNCTION

   nMax = GetMenuItemCount(hMenu)

   FOR Index = 0 TO nMax
    CALL GetMenuString(hMenu, Index, szString, 256, %MF_BYPOSITION)
    TM = UCASE$(TRIM$(szString, ANY CHR$(0,32)))
        FOR Itm = 1 TO UBOUND(KW())
             IF LEN(TRIM$(KW(Itm))) THEN
                 IF INSTR(TM, UCASE$(TRIM$(KW(Itm)))) THEN
                    EnableMenuItem(hMenu, Index, %MF_BYPOSITION OR %MF_DISABLED OR %MF_GRAYED)
                    EXIT FOR
                 END IF
             END IF
        NEXT Itm
   NEXT Index

   FUNCTION = %TRUE

END FUNCTION
'==================================================================================================================
CALLBACK FUNCTION DialogProc()

  LOCAL Result AS LONG
  STATIC LHook AS DWORD
  
  SELECT CASE CBMSG
    CASE %WM_INITDIALOG
        LHook = SetWinEventHook(%EVENT_SYSTEM_MENUPOPUPSTART, %EVENT_SYSTEM_MENUPOPUPSTART, 0, _
                                CODEPTR(WinEventFunc), 0, 0, %WINEVENT_OUTOFCONTEXT OR %WINEVENT_SKIPOWNTHREAD)
                                
    CASE %WM_DESTROY
        Result = UnhookWinEvent(LHook)
        
    CASE 19923
        IF ISTRUE(CBWPARAM=2991) AND ISTRUE(CBLPARAM=3909) THEN
            FUNCTION = VARPTR(CYI)
            EXIT FUNCTION
        END IF

    CASE %WM_COMMAND
        IF CBCTL = 103 THEN
            CONTROL GET TEXT CBHNDL, 102 TO CYI.hStrings
            CYI.Active = %TRUE
            MSGBOX "Ok, now go and open a menu that contains one of the blocked keywords in another program!" & $CRLF & _
                   "" & $CRLF & _
                   "Note: Some options may not be enabled until the next time the host program of the " & $CRLF & _
                   "popup menu is restarted. Don't open any popup menus in programs you dont want to restart.",%MB_ICONINFORMATION,"Filter is ready."
        END IF
  END SELECT
END FUNCTION
'==================================================================================================================
FUNCTION PBMAIN () AS LONG

  LOCAL hDlg AS DWORD
  DIM   CYI  AS GLOBAL BLOCKDATA
  
  DIALOG NEW 0, "Popup Options blocker", ,, 155, 70, %WS_SYSMENU TO hDlg

  CONTROL ADD LABEL,   hDlg, 101, "Key items to block separated with comma.", 5,  6, 134, 12, 0
  CONTROL ADD TEXTBOX, hDlg, 102, "cut,copy,properties", 5,  20, 140, 12, 0
  CONTROL ADD BUTTON,  hDlg, 103, "Block!", 55, 34, 40, 14, %BS_DEFAULT

 DIALOG SHOW MODAL hDlg, CALL DialogProc


END FUNCTION
'==================================================================================================================