News:

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

SubClass Vk_Back

Started by ragdog, July 17, 2010, 12:04:57 PM

Previous topic - Next topic

ragdog

Hi

Can any help me by a problem with subclass and vk_Back by Wm_Keydown?


.elseif uMsg==WM_KEYDOWN
  mov eax,wParam
        .if al==VK_BACK
            invoke    CallWindowProc,EditOldProc,hEdit,uMsg,eax,lParam
       
        .else
            invoke CallWindowProc,EditOldProc,hEdit,uMsg,wParam,lParam
            ret
        .endif


How i can delete a sign from the edit?

Greets,

MichaelW

#1
If by "delete a sign from the edit" you mean delete a character, the normal behavior of the backspace key in an edit control is to delete the character to the left of the caret.

Also, I don't understand what you are trying to do. In your IF block both of the INVOKE statements will pass wParam to the old Edit procedure.
eschew obfuscation

ragdog

I trying to delte a character by keydown

Thanks

MichaelW

To delete a character you could select the character with an EM_SETSEL message and then delete it with a WM_CLEAR or WM_CUT message. If you are doing this in a subclass procedure, are you trying to restrict the characters that the user can input?
eschew obfuscation

ragdog

Quoteare you trying to restrict the characters that the user can input?

Yes only numbers

Ok I try your solution

Thanks

MichaelW

To restrict the input to numbers you can include the ES_NUMBER style, but note that this will allow only decimal numbers, no decimal point or hex digits, and that the user can still paste non-digits into the control.

If that is not acceptable, I posted a different solution where you have more control here.
eschew obfuscation

ragdog