Splash.cpp
上传用户:oldpeter23
上传日期:2013-01-09
资源大小:1111k
文件大小:2k
源码类别:

IP电话/视频会议

开发平台:

Visual C++

  1. //NetTalk
  2. /*------------------------------------------------------------------------------*
  3.  =============================
  4.    模块名称: Splash.cpp
  5.  =============================
  6.  
  7.  [版权]
  8.  
  9.    2000-2002  115软件工厂  版权所有
  10.                                               
  11. *------------------------------------------------------------------------------*/
  12. #include "WndX.h"
  13. #include "Splash.h"
  14. /*------------------------------------------------------------------------------*/
  15. CSplash::CSplash(UINT nTime)
  16. {
  17. m_nTime=nTime;
  18. }
  19. /*------------------------------------------------------------------------------*/
  20. CSplash::~CSplash()
  21. {
  22. }
  23. /*------------------------------------------------------------------------------*/
  24. LRESULT CSplash::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
  25. {
  26. switch(uMsg)
  27. {
  28. case WM_INITDIALOG:
  29. {
  30. POINT pt[7]={{11,0},{134,0},{155,21},{297,21},{297,148},{0,148},{0,11}};
  31. HRGN hrgn=CreatePolygonRgn(pt,7,ALTERNATE);
  32. SetWindowRgn(m_hWnd,hrgn,FALSE);
  33. SetTimer(m_hWnd,0,m_nTime,0);
  34. SetWindowPos(m_hWnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
  35. }
  36. break;
  37. case WM_TIMER:
  38. {
  39. DestroyWindow(m_hWnd);
  40. KillTimer(m_hWnd,wParam);
  41. }
  42. break;
  43. case WM_ERASEBKGND:
  44. return TRUE;
  45. case WM_NCDESTROY:
  46. {
  47. CWndX::OnNcDestroy();
  48. delete this;
  49. }
  50. break;
  51. case WM_LBUTTONDOWN:
  52. {
  53. DestroyWindow(m_hWnd);
  54. }
  55. break;
  56. default:
  57. return FALSE;
  58. }
  59. return TRUE;
  60. }
  61. /*------------------------------------------------------------------------------*/
  62. BOOL CSplash::CreateSplash(UINT uTemplate)
  63. {
  64. BOOL bRet=FALSE;
  65. if(!CDialogX::Create((LPCTSTR)uTemplate,0))
  66. goto RET;
  67. ShowWindow(m_hWnd,SW_SHOW);
  68. bRet=TRUE;
  69. RET:
  70. return bRet;
  71. }