Restrict moving of dialog

Restrict moving of dialog

Postby fraxzi » Mon Feb 08, 2010 7: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Restrict moving of dialog

Postby ukoenig » Mon Feb 08, 2010 5:25 pm

I tested the Solution from RAMESHBABU, to disable Dialog-Move

Code: Select all  Expand view

#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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Restrict moving of dialog

Postby fraxzi » Tue Feb 09, 2010 3: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi and 38 guests