Animacion de Ventamas

Post Reply
devtuxtla
Posts: 392
Joined: Tue Jul 29, 2008 1:55 pm

Animacion de Ventamas

Post by devtuxtla »

Hola Fivewinnes


Desde la version de xHarbour 0.99 he utilizado este codigo para animar aleatoriamente el inicio y final de cada ventana, sin embargo con la version de xHarbour 1.2.3. (build 20161218) y Bc7 me envia en error 9003.
Con esta version ultima de xHarbour que cambia en el llamado de esta API ?
(es una aportacion del foro)

Code: Select all | Expand

ACTIVATE DIALOG oPD CENTERED ON INIT NW_ANIMA( oPD )  ;                    Valid( Fade( oPD ), .T. )*--------------------------------------------------------------*FUNCTION NW_ANIMA( oDlg )*--------------------------------------------------------------*LOCAL nSel:= nRandom(6)LOCAL cAni:= ""IF nSel == 1   //a) desde la esquina inferior izquierda hasta la esquina superior derecha:   cAni:= AW_VER_NEGATIVE + AW_HOR_POSITIVE + AW_SLIDE + AW_ACTIVATEELSEIF nSel == 2   //b) desde la esquina inferior derecha hasta la esquina superior izquierda:   cAni:= AW_HOR_NEGATIVE + AW_VER_NEGATIVE + AW_SLIDE + AW_ACTIVATEELSEIF nSel == 3   //c) desde la esquina superior derecha hasta la esquina inferior izquierda:   cAni:= AW_HOR_NEGATIVE + AW_VER_POSITIVE + AW_SLIDE + AW_ACTIVATEELSEIF nSel == 4   //d) Aparecer desplazandose de izquierda a derecha   cAni:= AW_HOR_POSITIVE + AW_SLIDE + AW_ACTIVATEELSEIF nSel == 5   //e) desde la esquina superior izquierda hasta la esquina inferior derecha:   cAni:= AW_HOR_POSITIVE + AW_VER_POSITIVE + AW_SLIDE + AW_ACTIVATEELSEIF nSel == 6   //f) aparecer desde el centro:   cAni:= AW_CENTER + AW_SLIDE + AW_ACTIVATEELSEIF nSel == 0   cAni:= AW_BLENDENDIF AnimateWindow( oDlg:hWnd, 500, cAni )oDlg:Refresh()RETURN 0DLL32 FUNCTION AnimateWindow( hWnd As LONG, dwTime As LONG, dwFlags As LONG ) AS LONG PASCAL ;               from "AnimateWindow" lib "user32.DLL"*--------------------------------------------------------------*FUNCTION fade( oDlg, oWner )*--------------------------------------------------------------*LOCAL nSel:= nRandom(6)LOCAL cAni:= AW_VER_NEGATIVE + AW_HOR_POSITIVE + AW_SLIDE + AW_HIDEIF nSel == 1   //a) desde la esquina inferior izquierda hasta la esquina superior derecha:   cAni:= AW_VER_NEGATIVE + AW_HOR_POSITIVE + AW_SLIDE + AW_HIDEELSEIF nSel == 2   //b) desde la esquina inferior derecha hasta la esquina superior izquierda:   cAni:= AW_HOR_NEGATIVE + AW_VER_NEGATIVE + AW_SLIDE + AW_HIDEELSEIF nSel == 3   //c) desde la esquina superior derecha hasta la esquina inferior izquierda:   cAni:= AW_HOR_NEGATIVE + AW_VER_POSITIVE + AW_SLIDE + AW_HIDEELSEIF nSel == 4   //d) Aparecer desplazandose de izquierda a derecha   cAni:= AW_HOR_POSITIVE + AW_SLIDE + AW_HIDEELSEIF nSel == 5   //e) desde la esquina superior izquierda hasta la esquina inferior derecha:   cAni:= AW_HOR_POSITIVE + AW_VER_POSITIVE + AW_SLIDE + AW_HIDEELSEIF nSel == 6   //f) aparecer desde el centro:   cAni:= AW_CENTER + AW_SLIDE + AW_HIDE//ELSEIF nSel == 0//   cAni:= AW_BLEND + AW_HIDEENDIFAnimateWindow( oDlg : hWnd, 500, cAni )oDlg : Hide()AnimateWindow( oDlg : hWnd, 500, AW_BLEND + AW_SLIDE + AW_ACTIVATE + AW_HIDE)IF !EMPTY(oWner)   //AnimateWindow( oDlg : hWnd, 500, AW_BLEND + AW_SLIDE + AW_ACTIVATE+AW_HIDE)   //oWner : show()   oWner : setcontrol()   oWner : setfocus()ENDIFRETURN 0 
Visite Chiapas, el paraiso de México.
User avatar
karinha
Posts: 7963
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 5 times
Contact:

Re: Animacion de Ventamas

Post by karinha »

Mira se no estás usando la version de ERRSSYSW.PRG de la version antigua y cambia para la nueva. Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
Posts: 7963
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 5 times
Contact:

Re: Animacion de Ventamas

Post by karinha »

Que intentas hacer, esto?

Code: Select all | Expand

#include "fivewin.ch"#define AW_VER_NEGATIVE        0x00000008  // animate window#define AW_SLIDE               0x00040000  // animate window#define AW_VER_POSITIVE  0x00000004#define AW_BLEND 0x00080000#define AW_HOR_NEGATIVE 0x00000002#define AW_HOR_POSITIVE 0x00000001#define AW_HIDE 0x00010000static owndidc, ownd, omsgbarfunction main()   oWndIdc := NIL   DEFINE WINDOW oWnd TITLE "Message Test - Press F3" ;      FROM 5, 5 TO 24, 64   DEFINE MSGBAR OMSGBAR OF OWND NOINSET   oWnd:bKeyDown := {|nKey| IF(nKey==VK_F3,FwhMsgIDC( 'Message test'),)}   ACTIVATE WINDOW oWnd maximizedreturn nil/***************************************************************************************************/procedure FwhMsgIDC( cMsg )   local oSay, oFontIDC, nPos, nCol, otimer   local nPosAux := 250   local nColAux := 245   Default cMsg := ''   if oWndIdc != nil      oWndIdc:End()      oWndIdc := nil      syswait(0.2)   endif   nPos := ownd:omsgbar:nWidth-nPosAux   nCol := ownd:omsgbar:ntop-nColAux   define font ofontidc name "Lucida Console" size -8,16 bold   define window owndidc title "Message" from nCol, nPos to ( nCol+nColAux ), ( nPos+nPosAux ) pixel nominimize nomaximize color CLR_BLACK, RGB(126,192,238) of oWnd   @ 00,-10 say osay var cMsg of owndidc center font ofontidc size 250,245 pixel   //AnimateWindow( owndidc:hwnd,400, nor( AW_SLIDE, AW_VER_NEGATIVE ) )   //AnimateWindow( owndidc:hwnd,400, nor( AW_SLIDE, AW_HOR_NEGATIVE ) )      //AnimateWindow( owndidc:hwnd,400, nor( AW_SLIDE, AW_HOR_POSITIVE ) )      AnimateWindow( owndidc:hwnd,400, nor( AW_HOR_NEGATIVE ) )   SetWindowPos( owndidc:hwnd, -1, 0, 0, 0, 0, 3 )   activate window owndidc on init( oTimer := FlashWndTimer( owndidc ),;                                    owndidc:Refresh(), ;                                    oWndIdc:move(nCol,nPos),;                                       oWndidc:nWidth  := nPosAux,;                                       oWndidc:nHeight := nColAux,;                                       oWndIdc:Refresh(),;                                    SysRefresh() );                            valid( Keluar(),owndidc := nil,;                                   hb_gcall( .t. ),;                                   ofontidc:End(),;                                   oTimer:DeActivate(),;                                    .t. )                                                                              returnfunction Keluar()   aRect :=  GetClientRect(oWndIdc:hwnd)   nWidth := oWndidc:nWidth          for i := 1 to aRect[3]       oWndidc:nWidth  := nWidth       nWidth := nWidth - i       oWndIdc:Refresh()       SysRefresh()                                          nextreturn nil/********************************************************/FUNCTION FlashWndTimer( ohWnd, nDelay, bWhen )   local oTimer   DEFAULT  nDelay  := 2000   DEFAULT  bWhen   := { || .T. }   DEFINE TIMER oTimer INTERVAL nDelay ACTION (Flashing( ohWnd, bWhen ))   ACTIVATE TIMER oTimerRETURN oTimer/********************************************************/STATIC FUNCTION Flashing( ohWnd, bWhen )   static nStatus := 1   local hWnd   hWnd := iif( ValType(ohWnd) != "O", ohWnd, ohWnd:hWnd )   if Eval( bWhen, hWnd )      FlashWnd( hWnd, (nStatus := iif( nStatus == 1, 0, 1 )) )   endifRETURN .T.DLL32 STATIC FUNCTION FlashWnd( hWnd AS LONG, nInvert AS LONG ) AS LONG PASCAL FROM "FlashWindow" LIB "User32.dll"DLL32 FUNCTION AnimateWindow( hWnd AS LONG, nTime AS LONG, nFlags AS LONG ) AS BOOL PASCAL LIB "user32.dll"/* AW_ACTIVATE0x00020000Activates the window. Do not use this value with AW_HIDE.AW_BLEND0x00080000Uses a fade effect. This flag can be used only if hwnd is a top-level window.AW_CENTER0x00000010Makes the window appear to collapse inward if AW_HIDE is used or expand outward if the AW_HIDE is not used. The various direction flags have no effect.AW_HIDE0x00010000Hides the window. By default, the window is shown.AW_HOR_POSITIVE0x00000001Animates the window from left to right. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.AW_HOR_NEGATIVE0x00000002Animates the window from right to left. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.AW_SLIDE0x00040000Uses slide animation. By default, roll animation is used. This flag is ignored when used with AW_CENTER.AW_VER_POSITIVE0x00000004Animates the window from top to bottom. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.AW_VER_NEGATIVE0x00000008Animates the window from bottom to top. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.*/ 


João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
Posts: 7963
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 5 times
Contact:

Re: Animacion de Ventamas

Post by karinha »

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
devtuxtla
Posts: 392
Joined: Tue Jul 29, 2008 1:55 pm

Re: Animacion de Ventamas

Post by devtuxtla »

Hola karinha

Gracias por responder, pero el problema esta en la funcion DLL32 FUNCTION, TODOS los metodos utilizados de TODAS las DLL´s emiten el mismo problema.

El error aparecio en esta API de animacion de ventanas, pero se presenta al accesar cualquier metodo definido en DLL32 FUNCTION

Estoy migrando una aplicacion que habia compilado con FWH 13.08 / xHarbour 1.2.3 (Build 20141106) / Bcc 5.8

Ahora con FWH 17.02 / xHarbour 1.2.3 (Build 20170312) / Bcc 7.2 TODAS los metodos definidos con DLL32 FUNCTION emiten el mismo error

Code: Select all | Expand

+--------------------------------------------------------------------------------+|Error BASE/1089  Argument error: ABS Arguments: ( [ 1] = Type: P Val: 748B0000) ||(Quit)                                                                          ||Error BASE/1089  Argument error: ABS Arguments: ( [ 1] = Type: P Val: 748B0000) ||                                                                                ||Error at ...: ABS(0) in Module:                                                 ||Called from : ANIMATEWINDOW(0) in Module: C:\SISTPAK\PRG\SISTPACK.prg            |


Saludos
Visite Chiapas, el paraiso de México.
User avatar
karinha
Posts: 7963
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 5 times
Contact:

Re: Animacion de Ventamas

Post by karinha »

Como compilas la aplicación?

*.bat

y

*.lnk

?
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Post Reply