Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1997
  6. //
  7. // File: modeless.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // StatsDlg.cpp : implementation file
  11. //
  12. #include "stdafx.h"
  13. #include "modeless.h"
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19. /*---------------------------------------------------------------------------
  20. ModelessThread implementation
  21. ---------------------------------------------------------------------------*/
  22. IMPLEMENT_DYNCREATE(ModelessThread, CWinThread)
  23. BEGIN_MESSAGE_MAP(ModelessThread, CWinThread)
  24. END_MESSAGE_MAP()
  25. ModelessThread::ModelessThread()
  26. {
  27. }
  28. ModelessThread::ModelessThread(HWND hWndParent, UINT nIDD, HANDLE hEvent, CDialog *pModelessDlg) :
  29. m_hwndParent(hWndParent),
  30. m_pModelessDlg(pModelessDlg),
  31. m_nIDD(nIDD),
  32. m_hEvent(hEvent)
  33. {
  34. }
  35. ModelessThread::~ModelessThread()
  36. {
  37. SetEvent(m_hEvent);
  38. m_hEvent = 0;
  39. }
  40. int ModelessThread::InitInstance()
  41. {
  42. CWnd * pParent = CWnd::FromHandle(m_hwndParent);
  43. BOOL bReturn = m_pModelessDlg->Create(m_nIDD, pParent);
  44. if (bReturn)
  45. m_pMainWnd = m_pModelessDlg;
  46. return bReturn;
  47. }