|
-
Jun 23rd, 2011, 10:27 PM
#1
Thread Starter
Lively Member
-
Jun 23rd, 2011, 10:32 PM
#2
Thread Starter
Lively Member
Re: Firing an event on listview > columnheader > mouse move...
PS. For info, the routine looks something like this :
Code:
EDIT: Obsolete code.. was not used to find the real method
So basically I get the header's handle, then rectangle area, to be able to compare with mouse position..
I just need to put it 'somewhere' now...., hope someone has an idea =)
Last edited by castaway; Jun 28th, 2011 at 11:03 PM.
Reason: remove useless code
-
Jun 23rd, 2011, 10:46 PM
#3
Thread Starter
Lively Member
Re: Firing an event on listview > columnheader > mouse move...
I might use the WndProc and WM_MOUSEMOVE (?)
Will check that tomorrow....
-
Jun 24th, 2011, 08:42 PM
#4
Thread Starter
Lively Member
Re: Firing an event on listview > columnheader > mouse move...
Well.......
Neither the WM_MOUSEMOVE nor the WM_NCMOUSEMOVE message fires when moving the cursor over the header..
Anyone would have an idea how to catch those column header's mouse move ?
-
Jun 24th, 2011, 10:59 PM
#5
Thread Starter
Lively Member
Re: Firing an event on listview > columnheader > mouse move...
I'm working on subclassing now........ first results are pretty good 
/me like monologs lol
-
Jun 25th, 2011, 08:24 AM
#6
Thread Starter
Lively Member
Re: Firing an event on listview > columnheader > mouse move...
I subclassed the column header.
It looks ok so far : I can catch mouse move events =)
I'm now trying to use HDM_HITTEST instead of the routine I've done 2 days ago, since it will give me the column index directly..... (will be better)
I will post the result if I manage to make it work.
-
Jun 28th, 2011, 11:00 PM
#7
Thread Starter
Lively Member
Re: Firing an event on listview > columnheader > mouse move...
Ok I finally managed to do everything....
Here's what needs to be done, just in case someone needs that information one day or another :
- Subclass the Header control, assigning the header's handle to the subclass's instance
- Listen for WndProc messages. Catch WM_MOUSEMOVE events
- Use HDM_HITTEST to be able to find out which column we are over. The result will be in "<hittest>.iItem"
- (Write the code you need from that point)
I needed to have mouse move events to be able de ownerdraw properly a listview header.
My listview Column header now look similar to the systems column header, that is, with the help of uxtheme.dll and "DrawThemeBackground" etc.. I could reproduce the exact same drawing as windows does with all listview header state (hot, normal, pressed etc....)
Hope this can help someone one day, it took me quite a while to figure out..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|