I have a problem with a dialog box. It's a splash screen on which I want to
print information about the loading of my application.
What happens is that I can tell that my text is printed but then hidden
instantly again. I get an improved result when putting SplashPaint() below
EndPatin() with a DC found with GetDC(splashwindow), but this is not good
enough. First of all, the text is not printed initially. I could solve this,
yes, but it seems that when my window is asked to repaint entirely, my text
is ignored. If I draw another window partly on top of it, it works though.
Can anybody help me?
Kristian
Here is a piece of the code I am using:
static void SplashPaint(HDC hdc)
{
SetTextColor (hdc, RGB (0, 0, 0));
SetBkMode (hdc, TRANSPARENT);
for(int textline = 0; textline < TEXTLINECOUNT; textline++)
ExtTextOut (hdc, splashtextx, splashtexty + textline * 15, 0, NULL,
splashtext[textline], strlen (splashtext[textline]), NULL);
}
bool CALLBACK SplashDialogProc(HWND hwndDlg, UINT message, WPARAM wParam,
LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
switch (message)
{
case WM_PAINT:
{
hdc = BeginPaint(hwndDlg, &ps);
SplashPaint(hdc); // I have tried with ps.hdc as well.
EndPaint(hwndDlg, &ps);
return true;
}
}
return false;
}
For more about subclassing, check out
http://www.wdj.com/archive/1103/feature.html.
--
Regards,
Petter
http://pethesse.home.online.no/
"Anders And" <A...@andeby.com> wrote in message
news:8sv08r$f2p$1...@news.inet.tele.dk...