Hi all,
How can I restrict moving of captioned dialog by end-user?
Regards,
Fraxzi
#include "FiveWin.ch"
FUNCTION MAIN()
LOCAL oDlg, oSay
DEFINE DIALOG oDlg
@ 1, 1 SAY oSay PROMPT "";
SIZE 100, 20
@ 3, 1 BUTTON "Test";
ACTION TEST( oSay )
ACTIVATE DIALOG oDlg CENTER ;
ON INIT Disable_X_Move(oDlg, .F., .T.)
RETURN NIL
// ----------------------------
FUNCTION Disable_X_Move(oWinDlg, lDisableX, lDisable_Move)
LOCAL nCount := 0
LOCAL 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
IF lDisable_Move
IF cClass != "TDIALOG"
// To Disable `Move' Menu Item in Dialog
RemoveMenu( hMenu, 1, nOR( 1024 ) )
ELSE
// To Disable `Move' Menu Item in a Window
RemoveMenu( hMenu, nCount-2, nOR( 1024 ) )
ENDIF
ENDIF
DrawMenuBar( oWinDlg:hWnd )
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 71 guests