(original main problem resolved, see edit below)
OK, here's my problem.
I've got a regular window (made with CreateWindowEx) with a bunch of edit controls in a row (also made with CreateWindowEx in the first window's WM_CREATE) in each of which the user has to enter 0, 1 or 2 characters. To be able to do this at any kind of acceptable speed I want the user to be able to go to the next control by pressing Tab (like you would in a dialog) or Enter, or when there's already 2 characters in the box. I've managed to do the latter, but for the life of me I can't figure out how to catch an Enter, and I don't even know where to start looking for Tab.
Here's the code I've got so far (still a little beefy for a forum post, but hey, it's Windows and I couldn't make it any shorter than this, sorry 'bout that)
*code no longer necessary after edit*
I've tried searching the MSDN for a few hours and read this tutorial http://winprog.org/tutorial/ (and the accompanying FAQ) several times over but came up blank; the only examples I found all applied to dialogs, not regular windows.
Any help on how to get this (switching to the next control when the user presses enter or tab) to work or where to find out how would be greatly appreciated!
(edit) Oops. I had the forum set to showing only posts one month old, so after checking what I thought were all posts I didn't think I needed to do a search. The question has already been answered more than adequately before by adrianxw: http://cboard.cprogramming.com/showt...threadid=34436 My other question is still relevant though:
Another little thing, is it possible to prevent the user to right-click on a control and align the text to the left or right? I've found on the MSDN how to catch the user doing this in the parent window, but can't figure out how to center it again after it's happened (there doesn't seem to be a function or message for that). Thanks in advance!