News:

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

Listview & TrackPopupMenu

Started by dacid, November 21, 2008, 11:09:34 PM

Previous topic - Next topic

dacid

I see this on one source file:



.ELSEIF eax == WM_NOTIFY
....

  .IF   cx==NM_RCLICK

  ....
; I really dont know what the 1032H message is..i just reversed this from
; ProcDump. Should you know, you better mail me telling me so :).
; In short: if you right click on the first cell of any row then this message
; returns 1 in EAX, otherwise 0.

INVOKE SendMessage,hwndList,1032H,0,0
TEST EAX,EAX
JNZ ShowMenu
RET



In "ShowMenu" goes the TrackPopupMenu call so the menu only appears when a item is selected in the listview. Anyone knows what "1032H" is ? Is there other way to do this?


jj2007

It is LVM_GETSELECTEDCOUNT, but could you please explain what you are trying to do?

dacid

#2
I think it is pretty clear... i have a listview and i want to make a right-click menu that only appears when a item is selected in the listview.

P.D (I edited the message because i misunderstood due a bad interpretation (my primary language is not english) so i apologize ... sorry.


Tedd

Lose the attitude.


LVM_GETSELECTEDCOUNT only tells you how many items were selected, so that snippet will call ShowMenu if there are > 0 items selected.

Anyway, use LVM_HITTEST to see which item has been clicked on (if any) and then you can display your popup menu depending on which it is (use LVM_GETITEM if you need extra info on the item.)
No snowflake in an avalanche feels responsible.

dacid