The MASM Forum Archive 2004 to 2012

Project Support Forums => IDE Development and Support => Easy Code => Topic started by: Loneguy on January 27, 2011, 10:37:07 AM

Title: In Typing uppercase Conversion
Post by: Loneguy on January 27, 2011, 10:37:07 AM
Hello,

I have this problem:

Window1Campo12 Proc hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
      Push wParam
      Mov Eax, wParam
      .If (Al >= "a" && Al <= "z")
         Sub Al, 20H    ;convert to Uppercase
                                   Ret
      .EndIf
   Return FALSE
Window1Campo12 EndP

The problem is: How do I print the converted char into the editbox called Campo12? I tried to use the SetText function, but it does not split the chars as well while typing in the edit control. Could anyone help me?
Thank You
Title: Re: In Typing uppercase Conversion
Post by: Ramon Sala on January 27, 2011, 11:15:31 AM
Hi Loneguy,

Just set the 'CaseStyle' property of the edit control to 'Upper'.

Ramon
Title: Re: In Typing uppercase Conversion
Post by: Ramon Sala on January 27, 2011, 11:25:52 AM
On the other hand, if you want to code it manually, here is the code:

Window1Campo12 Proc hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
    .If uMsg == WM_CHAR
        Mov Eax, wParam
        .If (Al >= "a" && Al <= "z")
            Sub Al, 20H    ;convert to Uppercase
            Invoke CallDefaultProc, hWnd, uMsg, Eax, lParam
            Return TRUE
        .EndIf
    .EndIf
    Return FALSE
Window1Campo12 EndP


But always remember that you first have to filter messages (.If uMsg ==...)

Regards.
Title: Re: In Typing uppercase Conversion
Post by: Loneguy on January 27, 2011, 11:43:06 AM
Thank You very much indeed
Title: Re: In Typing uppercase Conversion
Post by: Ramon Sala on January 27, 2011, 11:49:33 AM
You're welcome!

Thanks for using Easy Code!