I'm trying to create a text editor in vc++, without using mfc's edit class. I've managed to capture the key pressed using WM_CHAR message, but now how can i add it into a string(or any character handling data type) so that i can display it in my client area using TextOut() or functons similar to it???
A:
if it's a plain char array then you can use
your_str[strlen(your_str)] = ch;
where ch is the character.
Watch our for running out of space in your_str
Diaa Sami
2009-08-09 13:24:16
sorry for asking an unclear question, once i get to know which key has been pressed(inside the WndProc, using WM_CHAR message and then using its wparam to know the key), what should i do to display it in my client area??.
2009-08-09 13:35:40
@Arun I'm not GDI expert but I think after you add the char to your string you should invalidate your editor area, this will lead to you getting a WM_PAINT so you can repaint the string again.
Diaa Sami
2009-08-09 14:14:02
yea, i understood. thanks for replying..
2009-08-09 15:44:02