hi;
i have a problem. I want to limit text input of two or more edit control. But i only limit one of them with SetWindowsHookEx
anyone give me some info about keyboard hooking.

Thanks and Regards.


I am learning. I will teach.
Posted on 2002-03-25 14:29:15 by RvaZero
superclassing will solve it. Check out ICZ tut #22.
Posted on 2002-03-25 14:32:17 by stryker
Get the handle of the Edit Control and send a Message with the EM_SETLIMITTEXT
Posted on 2002-03-25 14:47:08 by JimmyClif
But i am using dialog resource not window class. Now is this possible too? :(

thanks again.
Posted on 2002-03-25 15:16:14 by RvaZero
yes, with GetDlgItem, you pass the res id, then it returns the handle
Posted on 2002-03-25 15:18:40 by Asm_Freak
An example of subclassing not superclassing:



invoke GetDlgItem, hWnd, IDE_FINDSTR
invoke SetWindowLong, eax, GWL_WNDPROC, OFFSET FndProc

IDE_FINDSTR is the ID of your edit control
FndProc is a procedure that handles the messages of the edit control(IDE_FINDSTR)
Posted on 2002-03-25 15:22:07 by stryker
Thanks;
i wil try it.
Posted on 2002-03-25 15:24:35 by RvaZero
Isn't windows hooks and sub/superclassing a bit overkill if EM_SETLIMITTEXT
will do the trick? =)
Posted on 2002-03-25 15:25:54 by f0dder
lol, yeah it's a bit overkill but it's fun anyway :)
Posted on 2002-03-25 15:27:08 by stryker
I think EM_SETLIMITTEXT is nice for me. :)
Posted on 2002-03-25 15:30:37 by RvaZero
True stryker, sub/superclassing are nice & interesting topics, but
I guess we have to be careful not to confuse people :). (Yeah yeah,
I've probably done that myself more than once ;))
Posted on 2002-03-25 15:46:59 by f0dder