Hi.
I am trying to make a simple keyboard input with Win32API!
I want to record the keyboard input to a string, while showing the string as it makes progress. Just like a custom edit-childcontrol.
I have tried a lot, but I allways end up with ONE character less when using backspace, or deleting TWO chars instead of one and such... You can see under how I have taught:
Can someone show me a simple and correct way of doing this?Code:case WM_CHAR: switch(wParam) { case '\b': if(cursorPlace==11) { torf=true; } if(cursorPlace == 0) { buffer[cursorPlace]=' '; } if(cursorPlace > 0) { buffer[cursorPlace]=' '; cursorPlace--; } if(torf==true) { buffer[cursorPlace]=' '; torf=false; } break; case '\r': for(i=0; i<150; i++) { buffer[i]=' '; cursorPlace=0; } break; default: buffer[cursorPlace]=wParam; if(cursorPlace < 11)cursorPlace++; if(cursorPlace != 10) torf=false; break; } InvalidateRect(hwnd,NULL, true); return 0;



LinkBack URL
About LinkBacks


