Resource file to accept Animated Cursor

Other General Resources like icon sets, sound files etc.,

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Resource file to accept Animated Cursor

Post by Pablo César »

In the RC file of this, (pls download this attached file of this message, I tried to include .ANI file (see concept here) but is unsuccessfully.

If I force to change the mouse pointer by functon C FileCursor, then it's works perfectly.

Is this a Harbour bug or HMG wrong interpretation ?

How I could include MAGGY.ANI to RC file ?
Last edited by Pablo César on Mon Jan 09, 2017 11:59 am, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Resource file to acept Animated Cursor

Post by danielmaximiliano »

Hola Pablo :
no encontre en el enlace demo.prg solo los archivos y el ejecutable.

dentro del archivo de recursos esta bien especificado

Code: Select all

Anicursor  CURSOR      xxx.cur
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Resource file to acept Animated Cursor

Post by Pablo César »

danielmaximiliano wrote:dentro del archivo de recursos esta bien especificado

Anicursor CURSOR xxx.cur
Gracias Daniel por responder, siempre muy atento. :) Fijate que la extension es ".ANI" y no ".CUR", de todas formas ya lo habia intentado, y casi siempre me dá este error:
cursor file `Maggy.ani' does not contain cursor data
Busqué en internet por "Anicursor" (como vos nombraste) pero no encontré algo que se pueda usar con el archivo RC. Lo único que encontré es que debemos colocar asi:

MAGGY ANICURSORS Maggy.ani

Pero tambien no funciona.

Me gustó este enlace que nos ofreciste, muy útil !

http://msdn.microsoft.com/en-us/library ... 85%29.aspx

De esta forma compila sin error pero la imagenes animadas (sequencias de imagenes) no las carga desde el RC.

---

Conclusion, am still without option to load animated cursor files from the resource file (".RC"). :(
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Resource file to acept Animated Cursor

Post by danielmaximiliano »

Pablo: puedes subir Demo.prg ya que el archivo .Rar solo estan el proyecto, recursos , de configuracion y el ejecutable.
de esa manera puedo cambiar parte del codigo para implementar cursores animados.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Resource file to acept Animated Cursor

Post by Pablo César »

Si Daniel, esto ya lo hé puesto a disposicion en mi primer mensaje:
Pablo César wrote:In the RC file of this, (pls download this attached file of this message, I tried to include .ANI file (see concept here) but is unsuccessfully.
O entonces, click aqui: to download

Fijate en el demo.exe debe aparecer como cursor Maggy de los Simpsons como cursor encuanto mantienes apretado el botón del ratón.

Mi intención es proporcionar el archivo de cursor animado en el archivo de recursos. Asi el archivo de imagen poderia estar incrustado en el ejecutable. Sin precisa disponibilizar el archivo por separado.

---

Please note the image of Maggy (form Simpsons) must be displayed at meatime when you are holding down the mouse button.

My intention is to provide the animated cursor file in the resource file. Once the image file is embedded in the executable. But I do know how to do it... :(
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Resource file to acept Animated Cursor

Post by danielmaximiliano »

Los Cursores animados deben tener 256 colores de profundidad y el que se encuentra en el demo IRfanview detalla 16.7 millones 24 bits.
es real esa informacion ?
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Resource file to acept Animated Cursor

Post by Pablo César »

Sobre la cantidad de colores, no lo sé. Pero si ejecutas el ejecutable verás que funciona. Entonces no deberia dar problema al intentar ensamblarlo, no te parece ?

Debe ser algun problema en C:\hmg.3.1.5\SOURCE\c_resource.c (FINDRESOURCE y/o LOADRESOURCE) o en la própia IDE digo esto, por el siguinte mensaje de error:

"Resource compiler -42 cursor file <fle_name> does not contain cursor dat"

Por acaso, sabes alguna otra manera de ensamblar este archivo dentro del archivo ejecutable ?

--

About the number of colors, I do not know. But if you run the executable you will see that it works. So should not give problem when trying to assemble it, don't you think so ?

Must be some problem in C:\hmg.3.1.5\SOURCE\c_resource.c (FINDRESOURCE and/or LOADRESOURCE) or in the own of IDE, due the folowing error message:

"Resource compiler -42 cursor file <fle_name> does not contain cursor dat"

By the way, do you know any other way to assemble this file in the executable file ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Resource file to acept Animated Cursor

Post by danielmaximiliano »

Hola Pablo :


No entiendo mucho de C pero encuentro que falta funciones de manejo de cursores en el nucleo de HMG.
estos estan manejado por C:\hmg.3.1.5\SOURCE\c_resource.c

Code: Select all

HB_FUNC( LOADRESOURCE )
{
   hb_retnl( ( LONG ) LoadResource( ( HINSTANCE ) hb_parnl( 1 ), ( HRSRC ) hb_parni( 2 ) ) );
}

HB_FUNC( FINDRESOURCE ) // hResources, cResourceName, nResType )
{
   hb_retnl( ( LONG ) FindResource( ( HINSTANCE ) hb_parnl( 1 ), hb_parc( 2 ), MAKEINTRESOURCE( hb_parni( 3 ) ) ) );
}
por eso tu inclusion de C para cargar Cursores animados en el DEMO.
tambien me encontre con esto para modificar el cursor actual por otro

Code: Select all

Form_1.Cursor := "Move-32.cur"
el cursor se puede cargar al definir la ventana y no esta documentado.

Code: Select all

DEFINE WINDOW Form_1 ;
   AT 0,0 ;
   WIDTH 400 ;
   HEIGHT 200 ;
   TITLE 'Hello World!' ;
   MAIN ;
   Cursor 'HAND_OPEN';
   ON MOUSECLICK MoveActiveWindow()
te dejo un enlace que estuve viendo y me parece espectacular para aprender C en forma simple.
http://www.functionx.com/win32/Lesson01b.htm
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Resource file to acept Animated Cursor

Post by Pablo César »

Por lo que entiendo, primero se debe hacer la busca del apodo de la imagen con respecto al nombre del archivoy que lo busca dentro del archivo RC. Para eso utiliza primero la funcion
FindResource pero hay que pasar algunos parametros, como muestra este ejemplo:

hResourceData = FindResource (NULL, FileName, TypeResource);

Después basado en ese retorno, precisará cargarlo en la memória, como a seguir:

hGlobalResource = LoadResource (NULL, hResourceData);

La duda que tenia es saber donde se origina ese impedimiento. Por qué no está reconociento el tipo del archivo (TypeResource) ".ani". Si era en Harbour, si era en la IDE o si era en MInGW. La IDE, vos mismo probaste que no es porque ni alterando por fuera del IDE acepta, por lo tanto no es la IDE.

Me acordé del Build.bat que manipula el archivo RC adjuntando-lo con otro archivo ..\resources\filler y originando el archivo _temp.rc. Que después es tratado con un aplicativo llamado windres.exe (es un compilador de recursos) que está en la carpeta C:\hmg.3.1.5\MINGW\bin, ai podemos decir que el culpado es el compilador MINGW, si bien que este windres.exe parece ser de la Microsoft y mejor dicho ese utilitário que talvez precise ser actualizado o alterado para que acepte otro tipo de archivo sea para ANICURSORS o sea para CURSOR.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Resource file to acept Animated Cursor

Post by Pablo César »

Creo que este windres.exe que usamos no parece ser de la Microsoft. Vea este articulo:
http://oldwiki.mingw.org/index.php/MS%2 ... 20compiler

Como usamos con extension ".o" entonces es GNU, eso quiere decir que hay posibilidades de poder hacer implementaciones.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply