我想在静态控件中画一条线:
case WM_CREATE:
{
hgraph=CreateWindow(WC_STATIC,NULL,WS_CHILD|WS_VISIBLE|SS_CENTER,20,20,660,80,hWnd,NULL,NULL,NULL);
SendMessage(hgraph,WM_SETTEXT,NULL,(LPARAM) "My Static");
break;
}
case WM_PAINT:
{
hdc=GetDC(hgraph);
hp=CreatePen(0 ,5,RGB(0,100,0));
SelectObject(hdc,hp);
MoveToEx(hdc, 0, 0, 0);
LineTo(hdc, 100, 100);
ReleaseDC(hgraph, hdc);
}
break;
但它处于静态控制之下: