News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Why is ASSUME not ASSUMEing?

Started by georgek01, September 06, 2005, 02:46:14 PM

Previous topic - Next topic

QvasiModo

Quote from: georgek01 on September 08, 2005, 02:32:22 PM
WM_NOTIFY (lParam) points to NM_TREEVIEW.

What ToutEnMasm is trying to tell you is that when a WM_NOTIFY message arrives and NMHDR.code is NM_DBLCLK, the lParam parameter doesn't point to a NM_TREEVIEW structure, but only to an NMHDR one. You can't access the "other members" of NM_TREEVIEW because what you're reading is not an NM_TREEVIEW structure.

georgek01

Oh!!!  :red

ToutEnMasm, I apologise profusely!

Seems I'll have to live with TRV_SELCHANGED only.

Thanks for all the assistance!
What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

QvasiModo

Quote from: georgek01 on September 08, 2005, 05:45:41 AM
How does TVM_HITTEST help me get to the value (in this case 99d) I assigned to lParam during TVM_INSERTITEM? Should I be using the hItem member from TV_HITTESTINFO?

Since NM_DBLCLK doesn't give you any more info, you can try to deduce on what item has the user clicked from the mouse coordinates. The TVM_HITTEST message takes the mouse coordinates as a parameter and returns the item.

Quote from: georgek01 on September 08, 2005, 05:45:41 AM
Quote...always check the imask member to see if the data is really there

As per my code above, I set the TVIF_PARAM flag indicating I want lParam to be available.

Sorry, I should have been more specific. I meant that when you get an NM_TREEVIEW structure you should read the imask member to see which members of iItem were set by the system.

Hope this helps! :U

georgek01

What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

Mark Jones

Quote from: georgek01 on September 08, 2005, 07:09:21 AM
Once I've check for TVN_SELCHANGED, the code works fine, but not once I've check for NM_DBLCLK. ...Any guesses why I'm able to get information from the TV_ITEM structure after a selection change but not a double click?

Another, roundabout idea to detect a double-click might be detecting single-clicks while waiting for a timer. Something like this:

    mov doubleclk,0

; single-click detected here
    .if doubleclk==1
; double-click detected here
    .else
        mov doubleclk,1                         ; flag as clicked once
        invoke SetTimer,hWnd,111,1000           ; 1 second

    .elseif eax==WM_TIMER                       ; timer expire routine
        mov eax,wParam
        .if eax==111
            mov doubleclk,0                     ; reset flag when timer expires
            invoke KillTimer,hWnd,111
        .endif
    .endif
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

QvasiModo

Double clicks are not just two clicks in a short time, they also have to happen within certain a distance. Well, actually the system uses a rectangle, but you get the idea :wink two quick clicks anywhere on the screen do not always make a double click.

In any case the problem is not that doubleclicks are not being detected, but that the NM_DBLCLK notification doesn't contain all the information we'd like. So we have to deduce some information from the mouse position instead. :)

Tedd

Try this..


[attachment deleted by admin]
No snowflake in an avalanche feels responsible.

georgek01

Ted, may I call you genius?  :U Thanks dude!
What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

Tedd

No snowflake in an avalanche feels responsible.