News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

how to get menu text when i right click one item;

Started by newrobert, April 06, 2017, 11:58:06 PM

Previous topic - Next topic

newrobert

i write a software, and there is a viewctrl, i want to get menu text when i right click one item;
currently i can pop up a menu list when i right click mouse;

hutch--

Hi Robert,

I moved the topic so you would have a better chance of an answer.

ragdog

Hello

Its a Listview WM_NOTIFY >>NM_RCLICK >>TrackPopupMenu

.elseif uMsg==WM_NOTIFY
;---track popup menu to the listview
invoke OnNotify,hWnd,wParam,lParam



OnNotify proc uses ebx edi hWnd:HWND,wParam:dword, lParam:dword
LOCAL pt:POINT
mov edx,lParam
assume edx:ptr NMHDR
.if [edx].idFrom == IDC_LIST && [edx].code == NM_RCLICK
invoke GetCursorPos,addr pt
invoke TrackPopupMenu,hPopMenu,TPM_LEFTALIGN,pt.x,pt.y,NULL,hWnd,NULL
.endif
assume edx:nothing
ret
OnNotify endp

newrobert

sorry for description, i want to get the item text of child in tree view;
such as the treeview have one root and three child node;
when i select root or one child node, and right click, i want to get the selected node text;

i want to use folowing messsage, but not effect, always return 0 in eax:
INVOKE     SendMessage, hWndTree, TVM_GETITEMSTATE, hItem, TVIS_SELECTED

jj2007

I am willing to help. How much are you willing to pay?


ragdog

Here is an example but is Goasm it is easy to convert it to Masm

http://www.masmforum.com/archive2012/10430_MenuTreeview.zip

newrobert

Quote from: ragdog on April 07, 2017, 07:01:27 PM
Here is an example but is Goasm it is easy to convert it to Masm

http://www.masmforum.com/archive2012/10430_MenuTreeview.zip

thank you very mcuh;

newrobert

#7
Quote from: jj2007 on April 07, 2017, 09:51:57 AM
I am willing to help. How much are you willing to pay?



sorry, i am fired at begin of this year and lost job a few month, and i don't know how long i can live without incoming;
if you have some very small order for coder&programer, i would like to take over it;
:(

One will do.

jj2007

Quote from: newrobert on April 07, 2017, 10:22:39 PMsorry, i am fired at begin of this year and lost job a few month

Sorry for that. But as a rule, asking for help without giving the slightest context, let alone full code, is like asking forum members to consult their crystal ball. Btw we are not good a mind-reading, either.

hutch--