flat assembler
Message board for the users of flat assembler.

Index > Windows > make static control as a button, any idea?

Author
Thread Post new topic Reply to topic
BiMode



Joined: 14 Sep 2007
Posts: 14
Location: Thailand
BiMode
Hello all,

I have a problem on simulating a button control using static control when mouse hovers on its area.

Currently I have:

Code:
invoke  SetWindowLong,[hStatic],GWL_EXSTYLE,WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE
        invoke  SetWindowPos,[hStatic],0,0,0,0,0,SWP_DRAWFRAME or SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER\
                or SWP_SHOWWINDOW
        invoke  InvalidateRect,[hStatic],0,    


but it doesn't work as i expect, any help would be appriciate: thx.


Last edited by BiMode on 09 May 2009, 12:12; edited 1 time in total
Post 09 May 2009, 01:04
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
I never use the standard common controls.
They are just too generic and very limited.
I use regular windows and custom procedures
to make all of my controls from scratch.
It takes a bit longer to code, but its way
easier to manipulate them later on in life.
If you are going to continue to try this way
may i suggest subclassing the controls wndproc.
Post 09 May 2009, 05:34
View user's profile Send private message Reply with quote
BiMode



Joined: 14 Sep 2007
Posts: 14
Location: Thailand
BiMode
Ok, I've found my own way to archive this, thx very much help guys!
Post 09 May 2009, 12:10
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
We are glad that you came to a solution, but please share it with other people too. Otherwise there will be no point in this thread. A person usually comes to forum expecting answers... Smile Thank you!
Post 09 May 2009, 15:09
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
BiMode



Joined: 14 Sep 2007
Posts: 14
Location: Thailand
BiMode
What my own method does is just simulate button behavior only (not all behavior), not real handler yet. I hope this can bring someone an idea. But bitshifter's way is much easier to implement i believe.


Description:
Download
Filename: test.zip
Filesize: 2.22 KB
Downloaded: 40 Time(s)

Post 14 May 2009, 01:00
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3043
Location: vpcmipstrm
bitRAKE
Maybe some ideas can be gleamed from my sub-class example - using a static to create a hyperlink.
Post 14 May 2009, 03:23
View user's profile Send private message Visit poster's website 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. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.