Taking into consideration locale-specific settings
You certainly can do everything yourself, however you have an option to
VarI4FromStr or similar API which does
dirty stuff for you. You put string in, you get
"Should accept only"
You don't specify how the control should enforce this exactly. What if
the input string is not valid? Control should be still accepting it
because, for example, string is just not yet valid and user is still
typing. If you are validating the input in external handler, such as when
OK button is pressed, then you don't even need to subclass. If you want to
check input every time it changes, you don't need to subclass either since
EN_CHANGE notifications on parent. You might want to
subclass for other reasons though.
It is user-friendly to accept any input and then indicate validity
somehow (such as underlining with red if invalid) either on text change or
on input validation.