FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Restrict moving of dialog
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Restrict moving of dialog
Posted: Mon Feb 08, 2010 07:13 AM

Hi all,

How can I restrict moving of captioned dialog by end-user?

Regards,
Fraxzi

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Restrict moving of dialog
Posted: Mon Feb 08, 2010 05:25 PM
I tested the Solution from RAMESHBABU, to disable Dialog-Move

Code (fw): Select all Collapse
#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
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.
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Restrict moving of dialog
Posted: Tue Feb 09, 2010 03:18 AM

Hello Ukoenig,

I tried the code but I can still drag the Dialog by the caption. Still movable :(

any more trick?

Regards,
Fraxzi

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15

Continue the discussion