Author |
Topic: Accessing the Window's API (Read 4481 times) |
|
Matt
Developer
member is offline


Gender: 
Posts: 210
|
 |
Re: Accessing the Window's API
« Reply #22 on: Oct 10th, 2010, 6:42pm » |
|
Hi Richard,
I'm using the assember and other parts from the program 'DIRdetails.bbc' (Can't remember where I got it.) These are the main parts.
WHEN WM_NOTIFY : IF sortcount%>-1 THEN IF click%(1) = sortcol% THEN direction% *= -1 C% = sortcount%+1 CALL indexsort%((direction%+1)/2), sort$(0,0), sort$(1,0) sortcol% = click%(1) ELSE direction% = 1 sortcol% = click%(1) PROC_SORT ENDIF relist% = TRUE ENDIF
FOR pass% = 8 TO 10 STEP 2 P% = code [OPT pass% .oldwndproc dd 0 : .hdn_itemclick mov eax,[eax+12] mov [esp+16],eax mov dword [esp+8],WM_COMMAND mov dword [esp+12],WM_NOTIFY jmp [oldwndproc] : .wm_notify mov eax,[esp+16] cmp dword [eax+8],HDN_ITEMCLICKA jz hdn_itemclick jmp [oldwndproc] : .newwndproc cmp dword [esp+8],WM_NOTIFY jz wm_notify jmp [oldwndproc] ] NEXT pass%
But this only seems to check for clicking on the column header. To check for the item I'm using,
SYS "SendMessage", hlist%, LVM_GETNEXTITEM, -1, LVNI_SELECTED TO index%
This gives a constant running value, so I can't even time a double click.
Are these the types of codings that you are referring to?
Matt
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Accessing the Window's API
« Reply #23 on: Oct 10th, 2010, 9:38pm » |
|
on Oct 10th, 2010, 6:42pm, Matt wrote:| I'm using the assember and other parts from the program 'DIRdetails.bbc'.... But this only seems to check for clicking on the column header. |
|
Since you're already using assembler code to handle the HDN_ITEMCLICKA notification you can add to that code to handle the NM_DBLCLK notification as well. The HDN_ITEMCLICKA gets converted by the assembler code to a WM_COMMAND message (which can easily be processed using ON SYS) so it would make sense to do just the same for the NM_DBLCLK notification.
As only one notification is intercepted by the existing code it isn't necessary to indicate which notification it was. Obviously once you're handling both HDN_ITEMCLICKA and NM_DBLCLK notifications you'll have to pass more information to your ON SYS handler; You could for example pass the notification code as the @lparam% parameter (currently unused), although it might be more consistent with the way List Boxes and other simple controls work to pass it in the high 16-bits of @wparam%.
Richard.
|
|
Logged
|
|
|
|
Michael Hutton
Developer
member is offline


Gender: 
Posts: 248
|
 |
Re: Accessing the Window's API
« Reply #24 on: Oct 12th, 2010, 12:11pm » |
|
Although not entirely relevant you may find this article useful when intercepting windows messages in assembler, especially those pesky WM_NOTIFY messages.
http://bb4w.wikispaces.com/Colour+text+in+a+List+View
It is, I admit, rather effusive and probably more confusing than helpful as I wrote it a while back but it may help. I would be interested in your comments!
Michael Hutton
|
|
Logged
|
|
|
|
|