News:

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

In Typing uppercase Conversion

Started by Loneguy, January 27, 2011, 10:37:07 AM

Previous topic - Next topic

Loneguy

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

Ramon Sala

Hi Loneguy,

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

Ramon
Greetings from Catalonia

Ramon Sala

#2
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.
Greetings from Catalonia

Loneguy


Ramon Sala

You're welcome!

Thanks for using Easy Code!
Greetings from Catalonia