Hello everyone,

I have created a dialog box (WinAPI). I added a Edit Control upon it. I want to draw inside with it using OPenGL.
I simply set the color of the background of the edit control to red.
The problem is that sometimes when dialog appear the edit control is not colored. When i bring another window on top of the dialog box it becomes colored. Sometimes when program starts everything is fine.

Here is the message processing procedure:
Code:
WM_INITDIALIG:
dc1 = GetDC(GetDlgItem(handle,IDC_EDIT1));
gldc1 = SetDCFormat(dc1);

WM_PAINT:
wglMakeCurrent(dc1,gldc1);
	GetClientRect(GetDlgItem(handle,IDC_EDIT1),&client_rect);
	draw();
	glFlush();
	SwapBuffers(dc1);
Maybe i need to process some additional messages?