flat assembler
Message board for the users of flat assembler.

Index > Windows > EditBox text only into DialogBox

Author
Thread Post new topic Reply to topic
Teehee



Joined: 05 Aug 2009
Posts: 568
Location: Brazil
Teehee
Hi.
I have a EditBox into a DialogBox and I'd like to let it text only (and _ ). How can I do that? For number only i know that there is a flag XX_NUMBER, there is something like that to text only?
if not, what should I do?

PS: my dialogbox is a resource.

_________________
Sorry if bad english.
Post 13 Jan 2010, 09:27
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
Teehee,

Subclass that instance of edit control and process WM_CHAR messages.
Post 13 Jan 2010, 11:29
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel
Since you're using a dialog resource for your editbox, get its handle using GetDlgItem.
Using SetWindowLong, change the editbox's procedure (GWL_WNDPROC attribute) and save the result (eax) for later.
All this goes into your WM_INITDIALOG handler.

Now the new procedure for the editbox will be like any other procedure.
In your WM_CHAR handler, check for anything between a/A and z/Z, and finally invoke CallWindowProc to resume the normal procedure. As you can imagine, lpPrevWndFunc is the result of SetWindowLong that you previously saved.

Phew Smile

EDIT: I know Revolution, I know. But it takes some time to edit those f***** BBs.

EDIT2: typo


Last edited by ManOfSteel on 13 Jan 2010, 11:54; edited 2 times in total
Post 13 Jan 2010, 11:41
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17287
Location: In your JS exploiting you and your system
revolution
Perhaps if enough of us got together we could convince Tomasz to alter the forum code to accept the brackets?
Post 13 Jan 2010, 12:01
View user's profile Send private message Visit poster's website Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
revolution wrote:
Perhaps if enough of us got together we could convince Tomasz to alter the forum code to accept the brackets?
There are problems not only with brackets, but also with other special symbols, which have to be typed as a hex codes preceded by '%', e.g. apostrophe

' = %27
Post 13 Jan 2010, 12:25
View user's profile Send private message Visit poster's website Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 568
Location: Brazil
Teehee
Thank you so much, ManOfSteel.
Post 13 Jan 2010, 17:04
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.