Introduction
This is the first article I submit to CodeProject so I want the more experienced members to help me. I don't known English very well, but I'll try my best.
This article tries to explain how to allow listview controls to edit its subitems like in spreadsheet controls. The code is written using the Win32 Native API as a counterpart of existing code written in MFC. Please tell me what you think and what I can do to improve it. Thanks in advance.
Using the code
In order to use the code, you must use two files: "StrViewWnd.cpp" and "StrViewWnd.h". These two files are fully commented to explain what each line of code does.
1. Creating the control
case WM_CREATE:
{
CreateStringView(hWnd,ID_LIST);
...
}
break;
2. Processing control notifications
case WM_NOTIFY:
{
LPNMHDR lpnmHdr = (LPNMHDR)lParam;
switch(lpnmHdr->idFrom)
{
case ID_LIST: return OnStrViewNotify(wParam,lParam);
}
}
break;
3. Reverting changes
case WM_DESTROY:
Revert();
PostQuitMessage(0);
break;
Ending
Well, that's all. I hope you enjoy it. Please send me your opinions, suggestions, etc.