I am working on a simple text-editor app and want to display the number of lines in the file (editbox) in the status bar. I try to process the WM_CHAR, WM_KEYUP or WM_KEYDOWN message, but they never get executed when I press a key. I have got this just before WM_COMMAND:
Where GetLines works perfectly:Code:case WM_CHAR:
if ((wParam = (WPARAM) CharUpper ((TCHAR *) wParam)) == VK_RETURN) GetLines(hwnd);
break;
I am trying to run GetLines whenever the enter key is pressed, but no matter how many times I press a key, the (UINT) msg never equals WM_CHAR or WM_KEYUP or WM_KEYDOWN. Any ideas?Code:void GetLines(HWND hwnd)
{
HWND hEdit = GetDlgItem(hwnd, IDC_MAIN_EDIT);
SendDlgItemMessage(hwnd, IDC_MAIN_STATUS, SB_SETTEXT, 1, (LPARAM)szLines);
}