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.

119 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1992-2000 Microsoft Corporation
  3. Module Name:
  4. ncmdwin.h
  5. Abstract:
  6. Command Window data structure and definition
  7. Environment:
  8. Win32, User Mode
  9. --*/
  10. extern BOOL g_AutoCmdScroll;
  11. class CMDWIN_DATA : public COMMONWIN_DATA {
  12. public:
  13. //
  14. // Internal class
  15. //
  16. class HISTORY_LIST : public LIST_ENTRY {
  17. public:
  18. PTSTR m_psz;
  19. HISTORY_LIST()
  20. {
  21. InitializeListHead( (PLIST_ENTRY) this );
  22. m_psz = NULL;
  23. }
  24. virtual ~HISTORY_LIST()
  25. {
  26. RemoveEntryList( (PLIST_ENTRY) this );
  27. if (m_psz) {
  28. free(m_psz);
  29. }
  30. }
  31. };
  32. public:
  33. //
  34. // Used to resize the divided windows.
  35. //
  36. BOOL m_bTrackingMouse;
  37. int m_nDividerPosition;
  38. int m_EditHeight;
  39. //
  40. // Handle to the two main cmd windows.
  41. //
  42. HWND m_hwndHistory;
  43. HWND m_hwndEdit;
  44. BOOL m_bHistoryActive;
  45. // Prompt display static text control.
  46. HWND m_Prompt;
  47. ULONG m_PromptWidth;
  48. HISTORY_LIST m_listHistory;
  49. // Character index to place output at.
  50. LONG m_OutputIndex;
  51. BOOL m_OutputIndexAtEnd;
  52. CHARRANGE m_FindSel;
  53. ULONG m_FindFlags;
  54. CMDWIN_DATA();
  55. virtual void Validate();
  56. virtual void SetFont(ULONG FontIndex);
  57. virtual BOOL CanCopy();
  58. virtual BOOL CanCut();
  59. virtual BOOL CanPaste();
  60. virtual void Copy();
  61. virtual void Cut();
  62. virtual void Paste();
  63. virtual BOOL CanSelectAll();
  64. virtual void SelectAll();
  65. virtual void Find(PTSTR Text, ULONG Flags);
  66. // Functions called in response to WM messages
  67. virtual BOOL OnCreate(void);
  68. virtual LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
  69. virtual void OnSetFocus(void);
  70. virtual void OnSize(void);
  71. virtual void OnButtonDown(ULONG Button);
  72. virtual void OnButtonUp(ULONG Button);
  73. virtual void OnMouseMove(ULONG Modifiers, ULONG X, ULONG Y);
  74. virtual LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
  75. virtual void OnUpdate(UpdateType Type);
  76. virtual ULONG GetWorkspaceSize(void);
  77. virtual PUCHAR SetWorkspace(PUCHAR Data);
  78. virtual PUCHAR ApplyWorkspace1(PUCHAR Data, PUCHAR End);
  79. void MoveDivider(int Pos);
  80. void AddCmdToHistory(PCSTR);
  81. void AddText(PTSTR Text, COLORREF Fg, COLORREF Bg);
  82. void Clear(void);
  83. };
  84. typedef CMDWIN_DATA *PCMDWIN_DATA;
  85. void ClearCmdWindow(void);
  86. BOOL CmdOutput(PTSTR pszStr, COLORREF Fg, COLORREF Bg);
  87. void CmdLogFmt(PCTSTR buf, ...);
  88. int CmdExecuteCmd(PCTSTR, UiCommand);