1

I'm learning and new to this. I've searched this for a long time and can't find any answer.

Every time I type text in an Edit control, it always turned to lowercase, even when using Shift or CapsLock. I did not put any lowercase/uppercase style on it:

hEditSub = CreateWindow("EDIT", NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | EM_SETHANDLE, 10, 334, 270, 20, hwnd_MainSub, NULL, hInstance_Main, NULL);

Is there any way to make it mixed case (allowing lower and uppercase)? Or is subclassing required?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
user5962153
  • 154
  • 2
  • 9

1 Answers1

5

EM_SETHANDLE is a window message constant and not a window style. Presumably it has numeric value that causes the behaviour. One imagines that your bogus style is being interpreted as ES_LOWERCASE.

Remove EM_SETHANDLE from your window style.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • oh crap, i was suspecting that thing, i got the code from someone else, but afraid of remove it, because i think it's default and standart from his code. it's now working, thank you very much, how stupid i was xD you solve 6 month worth of headache in one minute xD – user5962153 Jul 24 '16 at 13:42
  • 4
    Those curious little prefix warts actually mean something, @user. `EM` = edit message. `ES` = edit style. `WS` = window style. `WM` = window message. All of the common controls follow this theme. Makes it easy to tell that wrong code is wrong. If you are ever not sure, look it up in the documentation. Being afraid to remove something because you don't know what it means is kind of silly. *Find out* what it means! – Cody Gray - on strike Jul 24 '16 at 18:20