Urgente ( Texto Emergente )
Publicado por Carlos (43 intervenciones) el 15/08/2004 22:49:44
Hola FAMILIA!
Necesito saber cómo escribir un texto en la pantalla sin utilizar un diálogo ni un messagebox, actualmente utilizo esto pero no me funciona:
NOTA: Wnd es una variable (HWND) sacada de Wnd del cuadro de diálofo en el que estoy en ese momento
RECT gRectMsg;
HDC hDC;
hDC = GetDC(Wnd);
int error;
int len;
HBRUSH hBrush;
int color;
color = RGB(0,0,150);
len = strlen( str );
hBrush = CreateSolidBrush( color );
FillRect(hDC,&gRectMsg,hBrush);
SetBkColor(hDC,color);
SetTextColor(hDC,RGB(0,0,255));
gRectMsg.top = 0;
gRectMsg.bottom = 100;
gRectMsg.left = 0;
gRectMsg.right = 100;
DrawText( hDC,str, len,&gRectMsg, DT_SINGLELINE | DT_VCENTER );
ReleaseDC(Wnd,hDC);
DeleteObject( hBrush );
k puedo hacer?
Si veis el fallo, me podeis decir dónde encontrar algún ejemplo?
GRACIAS
Necesito saber cómo escribir un texto en la pantalla sin utilizar un diálogo ni un messagebox, actualmente utilizo esto pero no me funciona:
NOTA: Wnd es una variable (HWND) sacada de Wnd del cuadro de diálofo en el que estoy en ese momento
RECT gRectMsg;
HDC hDC;
hDC = GetDC(Wnd);
int error;
int len;
HBRUSH hBrush;
int color;
color = RGB(0,0,150);
len = strlen( str );
hBrush = CreateSolidBrush( color );
FillRect(hDC,&gRectMsg,hBrush);
SetBkColor(hDC,color);
SetTextColor(hDC,RGB(0,0,255));
gRectMsg.top = 0;
gRectMsg.bottom = 100;
gRectMsg.left = 0;
gRectMsg.right = 100;
DrawText( hDC,str, len,&gRectMsg, DT_SINGLELINE | DT_VCENTER );
ReleaseDC(Wnd,hDC);
DeleteObject( hBrush );
k puedo hacer?
Si veis el fallo, me podeis decir dónde encontrar algún ejemplo?
GRACIAS
Valora esta pregunta


0