Code: Select all
[code=fw]Now Animation curosor.ani working with FWH
Full Source
You need to download ANY file *.ani From the site http://www.rw-designer.com/cursor-set/stickman
AND Rename File In test.rc To Your New File Name
update 2012-5-25
add load cursor from file *.ani without file.rc
********************
Do you have something like this
If you like the source if I delete it!
Greetings
hathal.
********************* full source *********************************
file 1
******
****************
/*
anicur.ch command
TO USE Cursor Animation "curosor.ani"
BY HATHAL 2012-5-25
www.livesystem.net
*/
#xcommand DEFINE ANI CURSOR <oCursor> ;
[ <resource: RESOURCE, RESNAME, NAME> <cResName> ] ;
=> ;
<oCursor> := TAniCursor():New( <cResName>)
******************************************************
#xcommand DEFINE ANI CURSOR <oCursor> ;
[ <file:FILE,FILENAME,DISK> <cAnifile> ] ;
=> ;
<oCursor> := TAniCursor():Anifile( <cAnifile>)
**********************
**********************
file 2
******
******
/*
anicur.PRG class + c source
TO USE Cursor Animation "curosor.ani"
BY HATHAL 2012-5-25
www.livesystem.net
*/
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
CLASS TAniCursor
DATA hCursor
METHOD New( cResName) CONSTRUCTOR
METHOD Anifile(cAnifile) CONSTRUCTOR
METHOD End() INLINE If( ::hCursor != 0,::hCursor := 0,)
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New( cResName ) CLASS TAniCursor
::hCursor := LOAD_ANI_CURSOR( GetResources(), cResName )
return Self
METHOD Anifile(cAnifile) CLASS TAniCursor
if File(cAnifile)=.t.
::hCursor := LO_ANI_CU_FILE(cAnifile)
else
::hCursor:=0
endif
return Self
//----------------------------------------------------------------------------//
************************************************************
#pragma BEGINDUMP
// ********************************
#include "windows.h"
#include "hbapiitm.h"
#include "hbvm.h"
#include "hbstack.h"
#include "item.api"
#include "hbpcode.h"
#include "hbvmpub.h"
#define IF(x,y,z) ((x)?(y):(z))
#include "hbinit.h"
HINSTANCE GetInstance( void );
//----------------------------------------------------------------------------//
HB_FUNC (LO_ANI_CU_FILE)
{
HCURSOR H_ani_cursor;
H_ani_cursor=LoadCursorFromFile(hb_parc( 1 ));
hb_retnl( ( LONG ) H_ani_cursor );
}
HB_FUNC ( LOAD_ANI_CURSOR )
{
HRSRC H_Res;
DWORD D_wSize;
HGLOBAL H_Glob;
LPBYTE P_Bytes;
HINSTANCE H_Inst;
HCURSOR H_ani_cursor;
H_Inst=( HINSTANCE ) hb_parnl( 1 );
H_Res=FindResource(H_Inst,IF( ISCHAR( 2 ), hb_parc( 2 ),( LPSTR ) MAKEINTRESOURCE( hb_parnl( 2 ) ) ),"ANICURSORS");
D_wSize=SizeofResource(H_Inst,H_Res);
H_Glob=LoadResource(H_Inst,H_Res);
P_Bytes=(LPBYTE)LockResource(H_Glob);
H_ani_cursor=CreateIconFromResource(P_Bytes,D_wSize,FALSE,0x00030000);
hb_retnl( ( LONG ) H_ani_cursor );
}
#pragma ENDDUMP
*************************************
*************************************
file 4
*******
// test.prg
#include "FiveWin.ch"
#include "anicur.ch"
Set Procedure To anicur.PRG
/*
TEST.PRG
TO USE Cursor Animation "curosor.ani"
BY HATHAL 2012-5-25
www.livesystem.net
*/
function Main()
local oWnd,ani_cursor
DEFINE ANI CURSOR ani_cursor FILE "earth_w.ani"
// DEFINE ANI CURSOR ani_cursor RESOURCE "ID_ANI_CUR1"
DEFINE WINDOW oWnd FROM 5, 5 TO 20, 60 ;
TITLE "testing move curosor by hathal " ;
CURSOR ani_cursor
ACTIVATE WINDOW oWnd
return nil
// ***********************************************
file 5
******
test.rc
ID_ANI_CUR1 ANICURSORS "SPACE.ani"
/*
// DOWNLOAD ANY CUROSOR *.ANI FROM http://www.rw-designer.com/cursor-set/stickman
*/