home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 6.ddi / OWLDEMOS.ZIP / CURSAPP.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.3 KB  |  50 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #include "owl.h"
  4.  
  5. class TCursorApplication : public TApplication {
  6. public:
  7.     TCursorApplication (LPSTR name, HINSTANCE hInstance,
  8.                     HINSTANCE hPrevInstance, LPSTR lpCmd,
  9.             int nCmdShow)
  10.                : TApplication (name, hInstance,
  11.                            hPrevInstance, lpCmd, nCmdShow) {};
  12.     virtual void InitMainWindow();
  13. };
  14.  
  15. class IBeamWindow : public TWindow {
  16. public:
  17.     IBeamWindow(PTWindowsObject AParent, LPSTR ATitle)
  18.                  : TWindow(AParent, ATitle) {};
  19.     virtual LPSTR GetClassName();
  20.     virtual void GetWindowClass(WNDCLASS& AWndClass);
  21. };
  22.  
  23. LPSTR IBeamWindow::GetClassName()
  24. {
  25.     return "IBeamWindow";
  26. }
  27.  
  28. /* Call base class's GetWindowClass and then set IBeamWindow's cursor
  29.    to the predefined cursor IDC_IBEAM */
  30. void IBeamWindow::GetWindowClass(WNDCLASS& AWndClass)
  31. {
  32.   TWindow::GetWindowClass(AWndClass);
  33.   AWndClass.hCursor = LoadCursor(0, IDC_IBEAM);
  34. }
  35.  
  36. void TCursorApplication::InitMainWindow()
  37. {
  38.   MainWindow = new IBeamWindow (NULL, "Window With An I-Beam Cursor");
  39. }
  40.  
  41. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  42.            LPSTR lpCmd, int nCmdShow)
  43. {
  44.     TCursorApplication CursorApp ("CursorApp", hInstance, hPrevInstance,
  45.         lpCmd, nCmdShow);
  46.     CursorApp.Run();
  47.     return (CursorApp.Status);
  48. }
  49.  
  50.