Click to See Complete Forum and Search --> : How to put text in the window?


esselfe
May 26th, 2006, 03:29 PM
Hi!

I searched google and msdn for key words text, STATIC, blabla, but no_thing.
I need to display data(socket data) in the window. This text will change, but remain at the same position. I'm currently overridding the previous call of CreateWindowEx() by redefining this function for the same HWND variable...
I think this is not freeing memory huh? (although the code is not heavy)

there's the code:

void updateStatic(HWND *hWnd, char *text){
HWND text1 =NULL; // really necessary??
text1 =CreateWindowEx(0, "STATIC", text, WS_VISIBLE|WS_CHILD, 10,10,450,300, *hWnd, NULL, NULL, 0);
}

JamesSchumacher
May 26th, 2006, 08:05 PM
CreateWindowEx creates a window. If it's just text you want on your window and not necessarily creating a STATIC text child window - then see my reply to this person in the following thread.

http://www.codeguru.com/forum/showthread.php?t=388593