Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Win32 (http://www.go4expert.com/forums/win32/)
-   -   MessageBox or Dialogs erase text in window (http://www.go4expert.com/forums/messagebox-dialogs-erase-text-window-t25819/)

mestree 18May2011 00:10

MessageBox or Dialogs erase text in window
 
Hi I am using windows CE 6.0 for my development and when I write text in main window, the text appear normal, but when I send a MesageBox() or change a dialog visible or not all text in window are erased, for example I write
ExtTextOut(hdcP, rt.left, rt.top, ETO, &rt, szText, _tcslen(szText), NULL);
all time that I send
ShowWindow(hDialog, SW_HIDE); or MessageBox(hwndT, _T("This is a PRESS message"),_T("Hi!"), MB_OK);
it call
case WM_PAINT:
{
RECT rcClient;
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
EndPaint(hwnd, &ps);
}
and the text in window are erased. What is happening? What can I do for not erase text in window?

fashionbop 5Jul2011 15:28

Re: MessageBox or Dialogs erase text in window
 
1.
case WM_PAINT:
{
RECT rcClient;
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
ExtTextOut(hdcP, rt.left, rt.top, ETO, &rt, szText, _tcslen(szText), NULL);
EndPaint(hwnd, &ps);
}

2.call ValidateRect (hWnd,NUL,FALSE) ---- see MSDN


All times are GMT +5.5. The time now is 19:16.