The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: elmo on March 27, 2011, 06:41:19 AM

Title: LVN_ENDLABELEDIT
Post by: elmo on March 27, 2011, 06:41:19 AM
how can i get the text i enter after editing a lable of a listview item?
according to m$ the handle of the new created edit while editing the item is destroyed and there for i need to save the text and to reSet it's new text.

invoke SendDlgItemMessage,hWnd,ID,LVM_EDITLABEL, index, 0

i was thinking about
mov hEdit,eax
and get the new text from that handle, but as m$ said is that the edit is destoryed..
Title: Re: LVN_ENDLABELEDIT
Post by: elmo on March 27, 2011, 06:42:57 AM
owh this the answer (LVN_ENDLABELEDIT)

.if uMsg == WM_NOTIFY
.elseif wParam == idListView
mov eax, lParam
assume eax:PTR NMHDR
.if [eax].code == LVN_ENDLABELEDIT
assume eax:ptr LV_DISPINFO
.if [eax].item.pszText != NULL
ListView_SetItemText hwndListView, [eax].item.iItem, 0, [eax].item.pszText
.endif
assume eax:nothing
.endif
.endif


but I fail to get the value of text which i enter.
can someone please help me on this part?
thank you
Title: Re: LVN_ENDLABELEDIT
Post by: xandaz on March 03, 2012, 02:54:03 PM
    I'm sorry for reviving an old thread but i'd like to know if it's possible to enable label edition for a subitem. Does anyone know how to do this?
Title: Re: LVN_ENDLABELEDIT
Post by: fearless on March 03, 2012, 07:51:55 PM
Following on from this post: http://www.masm32.com/board/index.php?topic=17551.msg148170#msg148170

Ive updated my example to create an editbox in place of the subitem cell (in the example the 2nd col is an editable as a edit box, by default all text is selected and | caret is available for use)

Also added some custom messages to allow for specific allowed masks of data in Combo Drop Down (combo with the editbox portion) and editbox (2nd col example) - some stuff still might be left untested, but gives you an idea on how the custom messages and masks can be implemented (optional)

Couldnt get the datetimepicker combo to work correctly, issues with getting the constituent parts of that control - altho there is a function supported by vista or win7 (forget exact details) i think that allows it and i could of used it but wanted an xp compatible solution.

The editbox contents are saved if user presses ENTER or TAB, and are not saved if user moves away with mouse (clicking on another cell for example)
Title: Re: LVN_ENDLABELEDIT
Post by: donkey on March 03, 2012, 08:50:56 PM
Quote from: xandaz on March 03, 2012, 02:54:03 PM
    I'm sorry for reviving an old thread but i'd like to know if it's possible to enable label edition for a subitem. Does anyone know how to do this?

I think I can put together an example for you.
Title: Re: LVN_ENDLABELEDIT
Post by: xandaz on March 04, 2012, 10:28:47 AM
    Nice elmo...Thanks....good example....Thanks donkey.  :U