According to msdn, http://msdn.microsoft.com/en-us/library/bb774798%28VS.85%29.aspx,
returning TRUE prevents user from editing labels.
So I wrote the code below:
Main:
WinMain(...)
{
DialogBox(..., DlgProc)
}
DlgProc:
DlgProc(...)
{
switch(message) {
case WM_NOTIFY:
if((NMHDR *)lParam->code == LVN_BEGINLABELEDIT) {
return TRUE;
return FALSE;
...
}
Still, the labels can be edited. I dont want to cancel the style LVS_EDITLABELS, because sometimes I would like to allow the users edit labels.
Does anyone know the problem? Thank you.
Returning TRUE from a DialogProc() doesn’t mean what you think it does. Quoting from the MSDN library article: