How move a dialog

How move a dialog

Postby lailton.webmaster » Wed Mar 11, 2009 8: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
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: How move a dialog

Postby Enrico Maria Giordano » Wed Mar 11, 2009 8:52 am

This is a working sample:

Code: Select all  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: How move a dialog

Postby lailton.webmaster » Wed Mar 11, 2009 9:30 am

Thanks so much Enrico Maria Giordano

Perfect :mrgreen:
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: How move a dialog

Postby Silvio » 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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: How move a dialog

Postby lailton.webmaster » Wed Mar 11, 2009 5:58 pm

You can do it.
Code: Select all  Expand view

#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"
 


8)
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: How move a dialog

Postby Silvio » Thu Mar 12, 2009 12:51 am

It make a gpf
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: How move a dialog

Postby lailton.webmaster » Thu Mar 12, 2009 3: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
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: How move a dialog

Postby anserkk » Thu Mar 12, 2009 4:35 am

Silvio wrote:It make a gpf


It is working fine here in Windows XP Professional SP3.

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: How move a dialog

Postby Horizon » Thu Mar 12, 2009 7:41 am

Hi,

It works also in Vista Home Premium SP1.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: How move a dialog

Postby Silvio » Thu Mar 12, 2009 8: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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: How move a dialog

Postby StefanHaupt » Thu Mar 12, 2009 8: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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: How move a dialog

Postby Silvio » Thu Mar 12, 2009 10:18 am

I not found the error
With this prg

Code: Select all  Expand view
#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
Image

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

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: How move a dialog

Postby lailton.webmaster » Thu Mar 12, 2009 2: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...
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 69 guests