April 26, 2024, 02:43:40 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Would like to send @NMDBLCLK

Started by Bruce Peaslee, February 16, 2013, 09:58:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bruce Peaslee

I have a select/case setup that goes through a lot when the user double clicks on a Listview item. I also provide an "Edit" button the user can click to get the same result. I do not want to repeat all of the code and would like instead for the button to trigger a @NMDBLCLK message back to the Listview. I would have sworn I posted the solution here, but I sure cannot find it nor can I reproduce it. Does anyone have an idea of how this may be done? Thanks.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

LarryMc

The @NMDBLCLK message to a listview passes a pointer to a structure in lparam

I'm thinking you are not really wanting to do that (I may be wrong)
Sounds to me like just what you said
the edit control and the list view need some identical code and you don't want to duplicate it

If that is the case then put all the common code in a subroutine and pass it the necessary parameters.

If  want to in deed send the @NMDBLCLK message then you can do it sort of like this:
TYPE NMITEMACTIVATE
DEF hdr:NMHDR
DEF iItem:INT
DEF iSubItem:INT
DEF uNewState:INT
DEF uOldState:INT
DEF uChanged:INT
DEF ptAction:POINTER
DEF lParam:INT
DEF uKeyFlags:INT
ENDTYPE

def lvi:NMITEMACTIVATE
'fill out the structure
....
sendmessage (w1,@NMDBLCLK ,0,lvi,lv_id
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Bruce Peaslee

As I was falling asleep it seemed to me that a subroutine is the way, but I do want to see if I can make this work. Thanks.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles