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.

104 lines
2.6 KiB

  1. #ifndef __TSWIZARD_H__
  2. #define __TSWIZARD_H__
  3. /*++
  4. Copyright (C) 1997-1999 Microsoft Corporation
  5. Module Name:
  6. tswizard.h
  7. Abstract:
  8. header file for tswizard.cpp
  9. Author:
  10. William Hsieh (williamh) created
  11. Revision History:
  12. --*/
  13. typedef enum tagFixCommand
  14. {
  15. FIX_COMMAND_DONOTHING = 0,
  16. FIX_COMMAND_UPGRADEDRIVERS,
  17. FIX_COMMAND_REINSTALL,
  18. FIX_COMMAND_ENABLEDEVICE,
  19. FIX_COMMAND_STARTDEVICE,
  20. FIX_COMMAND_RESTARTCOMPUTER,
  21. FIX_COMMAND_DRIVERBLOCKED,
  22. FIX_COMMAND_TROUBLESHOOTER
  23. } FIX_COMMAND, *PFIX_COMMAND;
  24. typedef struct tagCMProblemInfo
  25. {
  26. BOOL Query; // true if we have something to fix the problem
  27. FIX_COMMAND FixCommand; // command to fix the problem
  28. int idInstFirst; // instruction text string id
  29. int idInstCount; // how many instruction string id
  30. int idFixit; // fix it string id
  31. }CMPROBLEM_INFO, *PCMPROBLEM_INFO;
  32. class CProblemAgent
  33. {
  34. public:
  35. CProblemAgent(CDevice* pDevice, ULONG Problem, BOOL SeparateProcess);
  36. ~CProblemAgent()
  37. {}
  38. // retreive the problem description text
  39. DWORD InstructionText(LPTSTR Buffer, DWORD BufferSize);
  40. DWORD FixitText(LPTSTR Buffer, DWORD BufferSize);
  41. // fix the problem
  42. BOOL FixIt(HWND hwndOwner);
  43. BOOL UpgradeDriver(HWND hwndOwner, CDevice* pDevice);
  44. BOOL Reinstall(HWND hwndOwner, CDevice* pDevice);
  45. BOOL RestartComputer(HWND hwndOwner, CDevice* pDevice);
  46. BOOL EnableDevice(HWND hwndOwner, CDevice* pDevice);
  47. BOOL FixDriverBlocked(HWND hwndOwner, CDevice* pDevice, LPTSTR ChmFile, LPTSTR HtmlTroubleShooter);
  48. BOOL StartTroubleShooter(HWND hwndOwner, CDevice *pDevice, LPTSTR ChmFile, LPTSTR HtmlTroubleShooter);
  49. BOOL GetTroubleShooter(CDevice* pDevice, LPTSTR ChmFile, LPTSTR HtmlTroubleShooter);
  50. void LaunchHtlmTroubleShooter(HWND hwndOwner, LPTSTR ChmFile, LPTSTR HtmlTroubleShooter);
  51. protected:
  52. CDevice* m_pDevice;
  53. ULONG m_Problem;
  54. int m_idInstFirst;
  55. int m_idInstCount;
  56. int m_idFixit;
  57. BOOL m_SeparateProcess;
  58. FIX_COMMAND m_FixCommand;
  59. };
  60. class CWizard98
  61. {
  62. public:
  63. CWizard98(HWND hwndParent, UINT MaxPages = 32);
  64. ~CWizard98()
  65. {}
  66. INT_PTR DoSheet() {
  67. return ::PropertySheet(&m_psh);
  68. }
  69. void InsertPage(HPROPSHEETPAGE hPage) {
  70. if (hPage && (m_psh.nPages < m_MaxPages)) {
  71. m_psh.phpage[m_psh.nPages++] = hPage;
  72. }
  73. }
  74. static INT CALLBACK WizardCallback(HWND hwndDlg, UINT uMsg, LPARAM lParam);
  75. PROPSHEETHEADER m_psh;
  76. private:
  77. UINT m_MaxPages;
  78. };
  79. #endif // #ifndef __TSWIZARD_H__