• Viernes 3 de Mayo de 2024, 04:49

Autor Tema:  problemas con fondo de dialogo  (Leído 803 veces)

diego.martinez

  • Miembro MUY activo
  • ***
  • Mensajes: 297
    • Ver Perfil
problemas con fondo de dialogo
« en: Miércoles 23 de Junio de 2010, 12:46 »
0
Buenas:

Estoy teniendo problemas para pintar un fondo a un dialogo.

Construyo el dialogo con DialogBox.

Despues, en el WM_PAINT hago
Código: C++
  1.  
  2.     case WM_PAINT:  
  3.             BeginPaint(hWnd,&ps);
  4.             Canvas->Swap();
  5.             EndPaint(hWnd,&ps);
  6.             return 1;
  7.  
  8.  

Canvas->Swap() hace:
Código: C++
  1.  
  2. //-------------------------------------------------------------------
  3. //  W32CANVAS::Swap
  4. /**
  5. //  Copia el contenido del canvas a la ventana target
  6. //  
  7. //  @author             Diego Martinez
  8. //  @version            10/Septiembre/2009
  9. */
  10. //-------------------------------------------------------------------
  11. void    W32CANVAS::Swap         ()
  12. {
  13.     RECT WindowSize;    
  14.  
  15.     GetClientRect             ((HWND)this->Target->Get(),&WindowSize);
  16.     SetStretchBltMode      (((W32WINDOW*)this->Target)->hDC,COLORONCOLOR);
  17.     StretchDIBits              (((W32WINDOW*)this->Target)->hDC,0,0,WindowSize.right,WindowSize.bottom, 0, 0, Width, Height, Data,&this->dib, DIB_RGB_COLORS, SRCCOPY);
  18.  
  19. }
  20.  
  21.  

Sin embargo, cuando se ejecuta, los controles del dialogo desaparecen y aunque haga InvalidateRect, dejan de verse.
Alguien sabe que estoy haciendo mal?

Gracias!!  ^_^