I think I got this code from Marcelo. I can't remember, but it works to get rid of the x on the top right hand corner:
ACTIVATE DIALOG oDlg ON INIT DisableX( oDlg, .T. )…
...
//---------------------------------------------------------------------------------
// FUNCTION DisableX(oWin, lDisable) to Disable X button of Window/Dialog
//---------------------------------------------------------------------------------
#define MF_BYPOSITION 1024 // 0x0400
#define MF_DISABLED 2
FUNCTION DisableX(oWin, lDisable)
LOCAL hMenu := 0
LOCAL nCount := 0
IF lDisable
hMenu = GetSystemMenu(oWin:hWnd, .F.)
nCount = GetMItemCount(hMenu)
IF oWin:ClassName() = "TDIALOG"
RemoveMenu(hMenu, 1, nOR( MF_BYPOSITION, MF_DISABLED) )
ELSE
RemoveMenu(hMenu, nCount - 1, nOR( MF_BYPOSITION, MF_DISABLED) )
RemoveMenu(hMenu, nCount - 2, nOR( MF_BYPOSITION, MF_DISABLED) )
ENDIF
DrawMenuBar( oWin:hWnd )
ELSE
GetSystemMenu( oWin:hWnd, .T. )
DrawMenuBar( oWin:hWnd )
ENDIF
RETURN nil
Reinaldo.