News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

filtering edit control input

Started by vadiu, December 17, 2005, 07:54:33 PM

Previous topic - Next topic

vadiu

I'm using some edit controls in a program, and I would like them to just receive numbers 0-9. How can I throw away letters and other characters? Do I have to take care of a windows message?


hutch--

vadiu,

Same comment as I made in the thread that Michael has located for you, learn how to write a subclass for the edit control and the rest is easy. Process the WM_CHAR message in the subclass and return ZERO for any keys you don't want. For the 0123456789 that you require, you also need the backspace and the rest you just throw away.

If you have MASM32 there is a tool on the code menu for creating a subclass for controls which takes the hack work out of what you want to do.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

farrier

vadiu,

Look at Iczelions Tutorial # 20

hth,

farrier
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

vadiu

Yep, I've read it.  :U Thanks. But now I have another question.
I'm using resources. So, how can I get a control handle given its ID?

petezl

Win32sdk
Search for GetDlgItem
Peter.
Cats and women do as they please
Dogs and men should realise it.