flat assembler
Message board for the users of flat assembler.

Index > Windows > how to change Cursor over Button ?

Author
Thread Post new topic Reply to topic
jochenvnltn



Joined: 15 Jul 2011
Posts: 83
jochenvnltn
Hello everyone.

Can someone explain how you can change the Cursor when you move over a Button ? In Delphi it's easy, but i would like to do everything in FASM from now on. I would like to change from IDC_ARROW to IDC_HAND. But only when over a Button Smile

thanks

Jochen
Post 14 Aug 2014, 16:24
View user's profile Send private message MSN Messenger Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
Been a while since I've done this kinda stuff...

You can load the cursor with LoadCursor and then either apply it to your button using SetClassLong (should apply it to all buttons) or trap WM_SETCURSOR to the button and use SetCursor for a specific button.
Post 14 Aug 2014, 16:52
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1409
Location: Toronto, Canada
AsmGuru62
Yes, trap it - subclass the HWND of a button.
Post 14 Aug 2014, 18:33
View user's profile Send private message Send e-mail Reply with quote
jochenvnltn



Joined: 15 Jul 2011
Posts: 83
jochenvnltn
Can i get an example please ? Ive tried using SetClassLong but it's not working ..
Post 14 Aug 2014, 18:55
View user's profile Send private message MSN Messenger Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
No need to subclass. Just trap WM_NOTIFY and look for this :

[BCN_HOTITEMCHANGE]
http://msdn.microsoft.com/en-us/library/windows/desktop/bb775984(v=vs.85).aspx


Then cast lParam to this:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb775959(v=vs.85).aspx

Second member of the structure specifies which event is taking place:

HICF_ENTERING or HICF_LEAVING
Post 15 Aug 2014, 03:32
View user's profile Send private message Reply with quote
jochenvnltn



Joined: 15 Jul 2011
Posts: 83
jochenvnltn
typedef wrote:
No need to subclass. Just trap WM_NOTIFY and look for this :

[BCN_HOTITEMCHANGE]
http://msdn.microsoft.com/en-us/library/windows/desktop/bb775984(v=vs.85).aspx


Then cast lParam to this:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb775959(v=vs.85).aspx

Second member of the structure specifies which event is taking place:

HICF_ENTERING or HICF_LEAVING


Thanks "typedef" Wink
How do i check HICF_ENTERING or HICF_LEAVING ?
I think this is very interesting stuff.
Can you show a simple example pls ? Smile
Post 15 Aug 2014, 14:33
View user's profile Send private message MSN Messenger Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1409
Location: Toronto, Canada
AsmGuru62
Code sample (sub-classing the button handle).


Description:
Download
Filename: BtnTest.Asm
Filesize: 5.29 KB
Downloaded: 78 Time(s)

Post 15 Aug 2014, 19:22
View user's profile Send private message Send e-mail Reply with quote
jochenvnltn



Joined: 15 Jul 2011
Posts: 83
jochenvnltn
AsmGuru62 wrote:
Code sample (sub-classing the button handle).

Thank you "AsmGuru62" !! Many thanks for your effort on this ! I I am really happy that i have learned something new that i can use so many times Smile FASM is like a very big book you always find something new and interesting in that's worth reading about. Ill never forget this. Thank you Smile
Post 16 Aug 2014, 00:22
View user's profile Send private message MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.