Another sample of Mouse's cursors

HMG Samples and Enhancements

Moderator: Rathinagiri

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

Another sample of Mouse's cursors

Post by Pablo César »

Hi all,

In this example I wish to change cursor for a single control but was not able probably due in SetWindowCursor function uses SetClassLongPtr instead SetWindowLongPtr according at web says SetClassPtr() is changing cursor for all controls, belonging to a class. :(

At begining I used for form a for one control which is accepting for all control at form.
Screen5.png
Screen5.png (34.17 KiB) Viewed 16055 times
I hope could be useful for inspiration...


Rgds
Attachments
CURSOR_3.rar
(47.11 KiB) Downloaded 290 times
Last edited by Pablo César on Thu Sep 22, 2016 8:00 pm, edited 2 times in total.
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

Another sample of Mouse'se cursors

Post by Pablo César »

Dear Rathi,

I forgot to mention that in HMG Resources folder there are two unuseful .cur files that IMO could be deleted. Files: hp_minus.cur and hp_plus.cur.

Rgds
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: Another sample of Mouse's cursors

Post by danielmaximiliano »

:D Gracias por Compartir Pablo
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Another sample of Mouse's cursors

Post by serge_girard »

Thanks Pablo !

Serge
There's nothing you can do that can't be done...
User avatar
quartz565
Posts: 667
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Contact:

Re: Another sample of Mouse's cursors

Post by quartz565 »

Ευχαριστώ Παύλο !
Best Regards,
Nikos.

os: Windows Server 2019 - 64
User avatar
mustafa
Posts: 1159
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Another sample of Mouse's cursors

Post by mustafa »

Hola amigo Pablo
Felicidades por tu linda aportación

Como podría hacer ? , para que un determinado botón al acercar el cursor
normal se convierta en otro cursor, antes de pulsar la ACTION
ahora lo consigo con la siguiente opción que aportó el Dr. Claudio Soto

Ejemplo si tengo varios Botones-> Button_1, Button_2 , Button_3 etc...

Pongo la siguiente sentencia asignado a cualquiera de los botones
y al acercar el cursor a cualquiera de los botones se convierte en
"finger.cur"

/*
END WINDOW

SETWINDOWCURSOR (Form_1.Button_1.Handle, "finger.cur")

Form_1.Center
Form_1.Activate

RETUR */

Mi problema es que todos los botones se reconvierten en este caso con "finger.cur"

Me gustaría aplicando tu Sample de asignar distintos cursores pero antes de pulsar
el Botón.

*----------------------------------- Google -------------------------------*
Hello friend Pablo
Congratulations on your beautiful contribution


How could I do? For a certain button to bring the cursor
Normal becoming another cursor before pressing the ACTION
now I get to the next option that Dr. Claudio Soto contributed

  Example if I have several Buttons-> Button_1, Button_2, Button_3 etc ...

I put the following statement assigned to any button
  and to bring the cursor to any button becomes
  "Finger.cur"

/*
  END WINDOW
   
    SETWINDOWCURSOR (Form_1.Button_1.Handle, "finger.cur")

    Form_1.Center
    Form_1.Activate

RETUR */

My problem is that all buttons are reconverted in this case with "finger.cur"

I would like to apply your Sample to assign different cursors but before pressing
the button.

Saludos/Regards
Mustafa
Attachments
Sample.zip
(1.02 KiB) Downloaded 266 times
Last edited by mustafa on Fri Sep 23, 2016 2:07 pm, edited 2 times in total.
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: Another sample of Mouse's cursors

Post by EduardoLuis »

Hi Pablo:

Very good and usefull your sample. Thanks for share.-
With regards.
Eduardo

Hola Pablo:

Muy bueno y útil tu ejemplo. Gracias por compartirlo
Eduardo
User avatar
Steed
Posts: 427
Joined: Sat Dec 12, 2009 3:40 pm

Re: Another sample of Mouse's cursors

Post by Steed »

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

Another sample of Mouse's cursors

Post by Pablo César »

mustafa wrote:Hola amigo Pablo
Felicidades por tu linda aportación

Como podría hacer ? , para que un determinado botón al acercar el cursor
normal se convierta en otro cursor, antes de pulsar la ACTION

..

Ejemplo si tengo varios Botones-> Button_1, Button_2 , Button_3 etc...

Pongo la siguiente sentencia asignado a cualquiera de los botones
y al acercar el cursor a cualquiera de los botones se convierte en
"finger.cur"

...

Mi problema es que todos los botones se reconvierten en este caso con "finger.cur"

Me gustaría aplicando tu Sample de asignar distintos cursores pero antes de pulsar
el Botón.
Hola Mustafa, gracias at ti a todos por el interés demonstrado.

Como mencioné justamente en mi primer mensaje, hay este inconveniente cuando usamos la función SetWindowCursor y que hace uso de SetClassLongPtr la cual está cambiando cursor para todos los controles, que pertenece a una clase. Según lo que dicen en internet es que deberia subtituir por SetWindowLongPtr en nuestro código en la biblioteca HMG. Pero esta información o solución deberia evaluarla Claudio Soto. Porque por lo que a mi me parece SetWindowLongPtr no parametriza con GCLP_HCURSOR (replaces a handle to the cursor) como lo hace con la funcion SetClassLongPtr y no veo solución simples a no ser que el usuário haga un función para controlar el evento simulando "mouseover".

Talvez Claudio encuentre una solución simples que sea interesante que pueda cambiar el cursor a un determinado control y no todos como lo hace ahora.

Links relacionados:
http://stackoverflow.com/questions/1027 ... n-a-button
https://msdn.microsoft.com/pt-br/librar ... s.85).aspx
https://msdn.microsoft.com/pt-br/librar ... s.85).aspx

Por esta razón, disponibilzé este ejemplo para demonstrar lo que se puede hacer y frizar la actual limitación con la función SetWindowCursor.

Saludos
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
mustafa
Posts: 1159
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Another sample of Mouse's cursors

Post by mustafa »

Gracias Pablo por la explicación tan documentada.
Un abrazo
Mustafa
Post Reply