FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How move a dialog
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
How move a dialog
Posted: Wed Mar 11, 2009 08:39 AM

How i can do to move a dialog only
using click mouse inside of dialog

i wan´t the same form that move the dialig when is clicked in cCaption more i want it INSIDE

it´s possivel ? someone can help ?

thanks

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How move a dialog
Posted: Wed Mar 11, 2009 08:52 AM
This is a working sample:

Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    ACTIVATE DIALOG oDlg;
             ON CLICK DRAGDLG( oDlg );
             CENTER

    RETURN NIL


STATIC FUNCTION DRAGDLG( oDlg )

    LOCAL aCoo := GETWNDRECT( oDlg:hWnd )
    LOCAL aOrg := GETCURSORPOS()

    LOCAL aPos, i

    oDlg:Refresh( .F. )

    WHILE GETKEYSTATE( VK_LBUTTON )
        aPos = GETCURSORPOS()

        MOVEWINDOW( oDlg:hWnd, aCoo[ 1 ] + aPos[ 1 ] - aOrg[ 1 ], aCoo[ 2 ] + aPos[ 2 ] - aOrg[ 2 ], , , .T. )

        FOR i = 1 TO 10
            SYSREFRESH()
        NEXT
    ENDDO

    RETURN NIL


EMG
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: How move a dialog
Posted: Wed Mar 11, 2009 09:30 AM

Thanks so much Enrico Maria Giordano

Perfect :mrgreen:

Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: How move a dialog
Posted: Wed Mar 11, 2009 10:51 AM

And YOu have an Idea to open and close with an animation a window or a dialog ?

Best Regards, Saludos



Falconi Silvio
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: How move a dialog
Posted: Wed Mar 11, 2009 05:58 PM
You can do it.
Code (fw): Select all Collapse
#Include "FiveWin.Ch"

#define AW_HOR_POSITIVE              0x00000001
#define AW_HOR_NEGATIVE             0x00000002
#define AW_VER_POSITIVE              0x00000004
#define AW_VER_NEGATIVE             0x00000008
#define AW_CENTER                   0x00000010
#define AW_HIDE                     0x00010000
#define AW_ACTIVATE                 0x00020000
#define AW_SLIDE                    0x00040000
#define AW_BLEND                    0x00080000

STATIC oWnd

Function Main()

   DEFINE WINDOW oWnd TITLE "FivewinBR"

   AnimateWindow( oWnd:hWnd, 600, nOr( AW_SLIDE, AW_HOR_POSITIVE ) )
   ACTIVATE WINDOW oWnd ON INIT oWnd:Refresh()

Return nil

DLL FUNCTION AnimateWindow( hWnd AS LONG, nTime AS LONG, nFlags AS LONG ) AS BOOL PASCAL LIB "USER32.dll"


:-)
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: How move a dialog
Posted: Thu Mar 12, 2009 12:51 AM

It make a gpf

Best Regards, Saludos



Falconi Silvio
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: How move a dialog
Posted: Thu Mar 12, 2009 03:22 AM
I don´t have GPF...

i use normal with xharbour+fivewin805+bcc55 (WinXP-Profissional SP3)


demo :-)
http://www.redstarsoft.com.br/xarquivos/win_animation.rar
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: How move a dialog
Posted: Thu Mar 12, 2009 04:35 AM
Silvio wrote:It make a gpf


It is working fine here in Windows XP Professional SP3.

Regards

Anser
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: How move a dialog
Posted: Thu Mar 12, 2009 07:41 AM

Hi,

It works also in Vista Home Premium SP1.

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: How move a dialog
Posted: Thu Mar 12, 2009 08:17 AM

I have Windows Xp Professional SP 3
and not run
I made also another tests and all made gpf

Best Regards, Saludos



Falconi Silvio
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: How move a dialog
Posted: Thu Mar 12, 2009 08:51 AM
Silvio,
Silvio wrote:I have Windows Xp Professional SP 3
and not run
I made also another tests and all made gpf


all tests you sent me are working fine here, XP pro 64bit.

You can try to find the address where the test crashes and then search this address in the map-file to find out the function, which causes the gpf.
kind regards

Stefan
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: How move a dialog
Posted: Thu Mar 12, 2009 10:18 AM
I not found the error
With this prg

Code (fw): Select all Collapse
#include "FiveWin.ch"

#define AW_HOR_POSITIVE             0x00000001
#define AW_HOR_NEGATIVE             0x00000002
#define AW_VER_POSITIVE             0x00000004
#define AW_VER_NEGATIVE             0x00000008
#define AW_CENTER                   0x00000010
#define AW_HIDE                     0x00010000
#define AW_ACTIVATE                 0x00020000
#define AW_SLIDE                    0x00040000
#define AW_BLEND                    0x00080000

function Main()

   local oWnd

   DEFINE WINDOW oWnd TITLE "Test"

   AnimateWindow( oWnd:hWnd, 600, nOr( AW_SLIDE, AW_HOR_POSITIVE ) )

   ACTIVATE WINDOW oWnd ;
      ON INIT oWnd:Refresh()

return nil

DLL FUNCTION AnimateWindow( hWnd AS LONG, nTime AS LONG, nFlags AS LONG ) AS BOOL PASCAL ;
   LIB "user32.dll"




made this error gpf


and the map file I sent you now
Best Regards, Saludos



Falconi Silvio
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: How move a dialog
Posted: Thu Mar 12, 2009 02:28 PM

It is working very fine here in Windows XP Professional SP3 and use too in Windows XP home edition
in my client, all right...

Continue the discussion