Solved

List-View control label editing problem

Posted on 1998-05-26
3
195 Views
Last Modified: 2013-12-03
I have a list-view control, its labels can be edited by the user. However, after typing just one character, Windows thinks I'm done, for some reason, sends a WM_NOTIFY with LVN_ENDLABELEDIT or whatever it's called, and, oddly enough, sends a WM_COMMAND with command identifier 1 (IDOK).
I think it thinks I canceled the editing, but I did not.

Using Windows NT and MSVC.
0
Comment
Question by:_Zaphod
3 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1404202
Check your "break" statements.
0
 
LVL 1

Author Comment

by:_Zaphod
ID: 1404203
That indeed was the obvious thing to do. It's not the problem though, because I placed a breakpoint there, and the values really were WM_COMMAND and 1.
0
 
LVL 7

Accepted Solution

by:
BlackMan earned 100 total points
ID: 1404204
It is possible to limit the amount of text the user may enter. If this in some way has been set to 1 (default is 30000), you'll get the result you describe.
Try setting the limit using the EM_LIMITTEXT message and see if that will do the trick.

EM_LIMITTEXT
wParam = (WPARAM) cchMax;   // text length, in characters
lParam = 0;                 // not used; must be zero
 
Parameters
cchMax
Value of wParam. Specifies the maximum number of characters the user can enter. If this parameter is zero, the text length is set to 0x7FFFFFFE characters for single-line edit controls or 0xFFFFFFFF for multiline edit controls.

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question