home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Examples / DDraw / DDraw1B / MAIN.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  1.4 KB  |  44 lines

  1. #ifndef MainH
  2. #define MainH
  3. //---------------------------------------------------------------------------
  4. #include <Classes.hpp>
  5. #include <Controls.hpp>
  6. #include <StdCtrls.hpp>
  7. #include <Forms.hpp>
  8. #include <Menus.hpp>
  9. #include <ExtCtrls.hpp>
  10. //---------------------------------------------------------------------------
  11. #define WM_RUNAPP WM_USER
  12.  
  13. class TForm1 : public TForm
  14. {
  15. __published:
  16.   void __fastcall FormDestroy(TObject *Sender);
  17.   void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
  18.     TShiftState Shift);
  19.   void __fastcall FormPaint(TObject *Sender);
  20.   void __fastcall Timer1Timer(TObject *Sender);
  21. private:
  22.   LPDIRECTDRAW            lpDD;           // DirectDraw object
  23.   LPDIRECTDRAWSURFACE     lpDDSPrimary;   // DirectDraw primary surface
  24.   LPDIRECTDRAWSURFACE     lpDDSBack;      // DirectDraw back surface
  25.   BOOL FActive;        // is application active?
  26.   BYTE FPhase;
  27.   RECT FShapeRect;
  28.   int FValueAdd;
  29.   AnsiString FrontMsg;
  30.   AnsiString BackMsg;
  31.   void __fastcall Start();
  32.   MESSAGE void Run(TMessage &Message);
  33.   void DrawShape(HDC &DC);
  34. public:
  35.   __fastcall TForm1(TComponent* Owner);
  36. BEGIN_MESSAGE_MAP
  37.   MESSAGE_HANDLER(WM_RUNAPP, TMessage, Run);
  38. END_MESSAGE_MAP(TForm);
  39. };
  40. //---------------------------------------------------------------------------
  41. extern TForm1 *Form1;
  42. //---------------------------------------------------------------------------
  43. #endif
  44.