I used the following code and it worked fine, allowed the user to only enter in numbers. I wanted to increase the functionality by using RichEdit so I added that.
I went from using:
wchar_t sampletext[] = L"foobar";
HWND inputText = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", sampletext,
ES_NUMBER | WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_MULTILINE,
10, 10, 500, 75, hWnd, NULL, *hInst, NULL);
to:
LoadLibrary(L"riched32.dll");
wchar_t sampletext[] = L"foobar";
HWND inputText = CreateWindowEx(WS_EX_CLIENTEDGE, L"RichEdit", sampletext,
ES_NUMBER | WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_MULTILINE,
10, 10, 500, 75, hWnd, NULL, *hInst, NULL);
Changing it allowed me to use CTRL+Z and CTRL+A and all but now for some reason I could enter characters that weren't numbers.
How do I fix this so Rich Edit only accepts number in this text field?
or
Alternatively, how would I create my own custom filter that would only accept numbers into the text field?
EDIT:
Here's an image of me typing