Good day ...
now more specific.
On member Window :: DrawWave ();
If I call the function InvalidateRect (hwnd, NULL, NULL);
When I try to open a file, the window OpenFile is only visible
pressing the F10 key, just like any MessageBox (...).
If you remove the call to InvalidateRect (...)
OpenFile (...) or MessageBox is visible, but not visible
the lines drawn.!
how can I fix this?
appreciate your comments, I'm new in programming in Windows
thanks

Code:
void Window::DrawWave(HDC dc,PAINTSTRUCT ps){
	  int x,z=0,y=0;
	  dc=BeginPaint(hwnd,&ps);
	  MoveTo(dc,20,Line);
	  LineTo(dc,BUFSIZE,Line);
	  MoveTo(dc,20,Line);
	  for(x=0;x<BUFSIZE;x++){
			 LineTo(dc,z+20,wavBuf[x]+y);
			 z++;
	  }
	  EndPaint(hwnd,&ps);
	InvalidateRect( hwnd, NULL,NULL); // Repaint to display the new name
}

LRESULT Window::WndProc(UINT iMessage,WPARAM wParam,LPARAM lParam){
		  HDC hdc;
		  RECT r;
		  int x;
		  PAINTSTRUCT ps;
		  switch(iMessage){
					case WM_COMMAND:
						  switch(GET_WM_COMMAND_ID(wParam,lParam)){
								 case CM_EXIT:
										DestroyWindow(hwnd);
										break;
								 case CM_U_FILEOPEN:
										CMUFileOpen();
										return 0L;
								 case CM_U_HELPABOUT:
										MessageBox(hwnd,szCMDLGAPAbout,"About Pautas",MB_OK);
										return 0L;
								 default:break;
						  }
						  break;
					case WM_CREATE:
						  szName[0]=0;
						  SoundSize=0;
						  Line=100;
						  wavBuf=new unsigned char[BUFSIZE];
						  break;
					case WM_PAINT:
						  DrawWave(hdc,ps);
                                                  break;
					case WM_DESTROY:
						  delete wavBuf;
						  if(szName){
								_lclose(hFile);
								szName[0]=0;
						  }
						  PostQuitMessage(0);
						  break;
					default:
						  return DefWindowProc(hwnd,iMessage,wParam,lParam);
		  }
		  return 0;
}