Leaked source code of windows server 2003
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.

49 lines
1.3 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // SYNOPSIS
  6. //
  7. // Declares the class HiddenDialogWithWorker.
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef HIDDENWORKER_H
  11. #define HIDDENWORKER_H
  12. #pragma once
  13. class HiddenDialogWithWorker : public CDialog
  14. {
  15. public:
  16. HiddenDialogWithWorker();
  17. virtual ~HiddenDialogWithWorker() throw ();
  18. // Start the worker thread.
  19. void Start();
  20. private:
  21. // Invoked in the worker thread.
  22. virtual LPARAM DoWork() throw () = 0;
  23. // Invoked in the dialog thread after the worker completes.
  24. virtual void OnComplete(LPARAM result) throw () = 0;
  25. virtual BOOL OnInitDialog();
  26. afx_msg LRESULT OnThreadMessage(WPARAM wParam, LPARAM lParam);
  27. DECLARE_MESSAGE_MAP()
  28. // Message signaling that the thread is complete.
  29. static const UINT threadMessage = WM_USER + 1;
  30. // Start routine for the worker thread.
  31. static DWORD WINAPI StartRoutine(void* arg) throw ();
  32. // Handle to the worker thread.
  33. HANDLE worker;
  34. // Not implemented.
  35. HiddenDialogWithWorker(const HiddenDialogWithWorker&);
  36. HiddenDialogWithWorker& operator=(const HiddenDialogWithWorker&);
  37. };
  38. #endif // HIDDENWORKER_H