The MASM Forum

General => The Campus => Topic started by: newrobert on April 06, 2017, 11:58:06 PM

Title: how to get menu text when i right click one item;
Post by: newrobert on April 06, 2017, 11:58:06 PM
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;
Title: Re: how to get menu text when i right click one item;
Post by: hutch-- on April 07, 2017, 01:28:04 AM
Hi Robert,

I moved the topic so you would have a better chance of an answer.
Title: Re: how to get menu text when i right click one item;
Post by: ragdog on April 07, 2017, 01:28:28 AM
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
Title: Re: how to get menu text when i right click one item;
Post by: newrobert on April 07, 2017, 08:49:02 AM
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
Title: Re: how to get menu text when i right click one item;
Post by: jj2007 on April 07, 2017, 09:51:57 AM
I am willing to help. How much are you willing to pay?

(http://static2.businessinsider.com/image/4e7f557369beddb21d00003b-1190-625/broken-crystal-ball-4-ways-to-future-proof-your-career.jpg)
Title: Re: how to get menu text when i right click one item;
Post by: 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
Title: Re: how to get menu text when i right click one item;
Post by: newrobert on April 07, 2017, 10:16:11 PM
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;
Title: Re: how to get menu text when i right click one item;
Post by: newrobert on April 07, 2017, 10:22:39 PM
Quote from: jj2007 on April 07, 2017, 09:51:57 AM
I am willing to help. How much are you willing to pay?

(http://static2.businessinsider.com/image/4e7f557369beddb21d00003b-1190-625/broken-crystal-ball-4-ways-to-future-proof-your-career.jpg)

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.
Title: Re: how to get menu text when i right click one item;
Post by: jj2007 on April 07, 2017, 10:46:18 PM
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.
Title: Re: how to get menu text when i right click one item;
Post by: hutch-- on April 07, 2017, 11:45:47 PM
Hi Robert, hope you find an income soon.