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.

98 lines
2.1 KiB

  1. //
  2. // CFileWindow.H
  3. //
  4. // File window class
  5. //
  6. //
  7. #ifndef _CFILEWINDOW_H_
  8. #define _CFILEWINDOW_H_
  9. //
  10. // Definitions
  11. //
  12. #define CFILEWINDOWCLASS TEXT("CFileWindowClass")
  13. //
  14. // Functions
  15. //
  16. //
  17. // CFileWindow
  18. //
  19. class
  20. CFileWindow
  21. {
  22. private: // data
  23. HWND _hParent; // parent window handle
  24. HWND _hWnd; // our window handle
  25. LONG _nLength; // current file length
  26. LONG _nLineCount; // number of lines
  27. BOOL _fVertSBVisible:1; // is the vertical scroll bar visible?
  28. //LPTSTR _pszEditBuffer; // edit buffer
  29. LPTSTR _pszFilename; // full filename
  30. LINEPOINTER * _pLine; // Line index
  31. ULONG _nNode; // file/node number
  32. private: // methods
  33. ~CFileWindow( );
  34. LRESULT
  35. _OnCommand( WPARAM wParam, LPARAM lParam );
  36. LRESULT
  37. _OnPaint( WPARAM wParam, LPARAM lParam );
  38. LRESULT
  39. _OnDestroyWindow( );
  40. HRESULT
  41. _LoadFile( LPTSTR pszFilename );
  42. LRESULT
  43. _OnFocus( WPARAM wParam, LPARAM lParam );
  44. LRESULT
  45. _OnKillFocus( WPARAM wParam, LPARAM lParam );
  46. LRESULT
  47. _OnTimer( WPARAM wParam, LPARAM lParam );
  48. BOOL
  49. _OnKeyDown( WPARAM wParam, LPARAM lParam );
  50. BOOL
  51. _OnKeyUp( WPARAM wParam, LPARAM lParam );
  52. HRESULT
  53. _UpdateTitle( );
  54. LRESULT
  55. _OnCloseWindow( );
  56. LRESULT
  57. _OnVerticalScroll( WPARAM wParam, LPARAM lParam );
  58. LRESULT
  59. _OnCreate( HWND hwnd, LPCREATESTRUCT pcs );
  60. LRESULT
  61. _OnSize( LPARAM lParam );
  62. LRESULT
  63. _OnMouseWheel( SHORT iDelta );
  64. HRESULT
  65. _ParseFile( );
  66. static DWORD WINAPI
  67. _ParseFileThread( LPVOID pParams );
  68. public:
  69. CFileWindow( HWND hParent );
  70. static LRESULT CALLBACK
  71. WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
  72. HRESULT
  73. SetInformation( ULONG nNode, LPTSTR pszFilename, LINEPOINTER * pLineBuffer, ULONG nLineCount );
  74. HRESULT
  75. GetWindow( HWND * phWnd )
  76. {
  77. *phWnd = _hWnd;
  78. return S_OK;
  79. }
  80. };
  81. typedef CFileWindow CFILEWINDOW;
  82. typedef CFileWindow * PCFILEWINDOW, *LPCFILEWINDOW;
  83. #endif // _CFILEWINDOW_H_