home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / wksinst / rwpdemo.pak / RWPDEMO.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1991-09-09  |  16.6 KB  |  552 lines

  1. {
  2.    This example can be compiled with either the
  3.    "standard" windows look or the "Borland look".
  4.    By default, it uses "standard" windows controls.
  5.    To cause it to use Borland Windows Custom Controls,
  6.    select Options.Compiler and enter BWCC in the
  7.    Conditional defines field.
  8.  
  9.    Copyright (c) 1991 by Borland International
  10. }
  11.  
  12.  
  13. {$ifdef BWCC}
  14. program RWPDemo;
  15. {$else}
  16. program RWPDemoB;
  17. {$endif}
  18.  
  19. {$ifdef BWCC}
  20. {$R RWPDEMOB.RES}
  21. {$else}
  22. {$R RWPDEMO.RES}
  23. {$endif}
  24. {$D 'Resource Workshop Demo Program. Copyright (c) Borland 1991'}
  25.  
  26. {$ifdef BWCC}
  27. uses WObjectB, WinTypes, WinProcs, Strings, RWPDemoC, RWPDlgs, RWPWnd, WinDOS, bwcc;
  28. {$else}
  29. uses WObjects, WinTypes, WinProcs, Strings, RWPDemoC, RWPDlgs, RWPWnd, WinDOS;
  30. {$endif}
  31.  
  32. const
  33.   AppName = 'RWPDEMO';
  34.  
  35. const
  36.   wm_DrawStatusLine: Word =   0;
  37.   StatusLineHeight        =  20;
  38.  
  39. const
  40.   TextStart               = 200; { Location for hints in status line }
  41.  
  42. const
  43.   EditFirst               = cm_Undo;
  44.   EnvironmentFirst        = cm_Preferences;
  45.   FileFirst               = cm_New;
  46.   Helpfirst               = cm_Index;
  47.   OptionFirst             = cm_Directories;
  48.   ViewFirst               = cm_All;
  49.   WindowFirst             = cm_Tile;
  50.  
  51. { Private Profile Identifiers}
  52. const
  53.   AppProfileName          = AppName + '.INI';
  54.   AutoSaveDesktopKey      = 'AutoSave Desktop';
  55.   AutoSaveEditorKey       = 'AutoSave Editor';
  56.   AutoSaveEnvironmentKey  = 'AutoSave Environment';
  57.   GraphicDirectoryKey     = 'Graphic Directory';
  58.   ScribbleDirectoryKey    = 'Scribble Directory';
  59.   TextDirectoryKey        = 'Text Directory';
  60.  
  61.  
  62. type
  63.   PRWPApplication = ^RWPApplication;
  64.   RWPApplication = object(TApplication)
  65.     AutoSaveEditor,
  66.     AutoSaveDesktop,
  67.     AutoSaveEnvironment: Boolean;
  68.     GraphicDirectory: array[0..128] of Char;
  69.     ScribbleDirectory: array[0..128] of Char;
  70.     TextDirectory: array[0..128] of Char;
  71.     constructor Init(AName: PChar);
  72.     destructor Done; virtual;
  73.     procedure InitMainWindow; virtual;
  74.     procedure ReadProfileInfo;
  75.     procedure WriteProfileInfo;
  76.   end;
  77.  
  78. type
  79.   PRWPWindow = ^TRWPWindow;
  80.   TRWPWindow = object(TMDIWindow)
  81.     BmpStatusBar: HBitmap;
  82.     BmpStatusLine: HBitmap;
  83.     CurrentID: Integer;
  84.     CurrentPopup: HMenu;
  85.     constructor Init(AParent: PWindowsObject; ATitle: PChar);
  86.     procedure AboutRWP(var Msg: TMessage); virtual cm_First + cm_About_RWP;
  87.     procedure BlastStatusLine(PaintDC: HDC);
  88.     procedure DefCommandProc(var Msg: TMessage); virtual;
  89.     procedure DefWndProc(var Msg: TMessage); virtual;
  90.     procedure Destroy; virtual;
  91.     procedure FileNew(var Msg: TMessage); virtual cm_First + cm_New;
  92.     procedure FileOpen(var Msg: TMessage); virtual cm_First + cm_Open;
  93.     procedure FilePrint(var Msg: TMessage); virtual cm_First + cm_Print;
  94.     procedure FileQuit(var Msg: TMessage); virtual cm_First + cm_Exit;
  95.     function  GetClassName: PChar; virtual;
  96.     procedure GetWindowClass(var WndClass: TWndClass); virtual;
  97.     procedure OpenAFile(FileType: Integer; FileName: PChar);
  98.     procedure OptionsDirectories(var Msg: TMessage); virtual cm_First+cm_Directories;
  99.     procedure OptionsMouse(var Msg: TMessage); virtual cm_First+cm_Mouse;
  100.     procedure OptionsOpen(var Msg: TMessage); virtual cm_First+cm_Options_Open;
  101.     procedure OptionsPreferences(var Msg: TMessage); virtual cm_First+cm_Preferences;
  102.     procedure OptionsSave(var Msg: TMessage); virtual cm_First+cm_Options_Save;
  103.     procedure OptionsSaveAs(var Msg: TMessage); virtual cm_First+cm_Options_Saveas;
  104.     procedure Paint(PaintDC: HDC; var PaintInfo: TPaintStruct); virtual;
  105.     procedure RunDialog(ADialog: PRWPDialog; ACaption: PChar);
  106.     procedure WindowArrangeIcons(var Msg: TMessage); virtual cm_First + cm_ArrangeIcons;
  107.     procedure WindowCascade(var Msg: TMessage); virtual cm_First + cm_Cascade;
  108.     procedure WindowCloseAll(var Msg: TMessage); virtual cm_First + cm_CloseAll;
  109.     procedure WindowTile(var Msg: TMessage); virtual cm_First + cm_Tile;
  110.     procedure WMDrawStatusLine(var Msg: TMessage);
  111.     procedure WMMenuSelect(var Msg: TMessage); virtual wm_First + wm_MenuSelect;
  112.     procedure WMEnterIdle(var Msg: TMessage); virtual wm_First + wm_EnterIdle;
  113.     procedure WMSize(var Msg: TMessage); virtual wm_First + wm_Size;
  114.   end;
  115.  
  116. {------------------------- TRWPApplication implementation ---------------}
  117.  
  118. constructor RWPApplication.Init(AName: PChar);
  119. begin
  120.   TApplication.Init(AName);
  121.   HAccTable := LoadAccelerators(HInstance, MakeIntResource(Acc_Main));
  122.   wm_DrawStatusLine := RegisterWindowMessage('RWPDrawStatusLine');
  123.   ReadProfileInfo;
  124. end;
  125.  
  126. destructor RWPApplication.Done;
  127. begin
  128.   if WordBool(AutoSaveEnvironment) then WriteProfileInfo;
  129.   TApplication.Done;
  130. end;
  131.  
  132.  
  133. procedure RWPApplication.WriteProfileInfo;
  134.  
  135.   procedure WritePrivateProfileBool(ApplicationName, KeyName: PChar;
  136.     Value: Boolean; FileName: PChar);
  137.   const
  138.     Tmp: array[False..True] of PChar = ('0','1');
  139.   begin
  140.     WritePrivateProfileString(ApplicationName, KeyName, Tmp[Value], FileName);
  141.   end;
  142.  
  143. begin
  144.   WritePrivateProfileBool(AppName, AutoSaveEditorKey, AutoSaveEditor,
  145.     AppProfileName);
  146.   WritePrivateProfileBool(AppName, AutoSaveDesktopKey, AutoSaveDesktop,
  147.     AppProfileName);
  148.   WritePrivateProfileBool(AppName, AutoSaveEnvironmentKey,
  149.     AutoSaveEnvironment, AppProfileName);
  150.   WritePrivateProfileString(AppName, TextDirectoryKey, TextDirectory,
  151.     AppProfileName);
  152.   WritePrivateProfileString(AppName, GraphicDirectoryKey, GraphicDirectory,
  153.     AppProfileName);
  154.   WritePrivateProfileString(AppName, ScribbleDirectoryKey, ScribbleDirectory,
  155.     AppProfileName);
  156. end;
  157.  
  158. procedure RWPApplication.ReadProfileInfo;
  159. begin
  160.   AutoSaveEditor := Boolean(GetPrivateProfileInt(AppName, AutoSaveEditorKey,
  161.     0, AppProfileName));
  162.   AutoSaveDeskTop := Boolean(GetPrivateProfileInt(AppName, AutoSaveDesktopKey,
  163.     0, AppProfileName));
  164.   AutoSaveEnvironment := Boolean(GetPrivateProfileInt(AppName,
  165.     AutoSaveEnvironmentKey, 0, AppProfileName));
  166.   GetPrivateProfileString(AppName, TextDirectoryKey, '', TextDirectory,
  167.     sizeof(TextDirectory), AppProfileName);
  168.   GetPrivateProfileString(AppName, GraphicDirectoryKey, '', GraphicDirectory,
  169.     sizeof(GraphicDirectory), AppProfileName);
  170.   GetPrivateProfileString(AppName, ScribbleDirectoryKey, '', ScribbleDirectory,
  171.     sizeof(ScribbleDirectory), AppProfileName);
  172. end;
  173.  
  174. procedure RWPApplication.InitMainWindow;
  175. begin
  176.   MainWindow := New(PRWPWindow, Init(nil, 'Resource Workshop Demo Program'));
  177. end;
  178.  
  179. {--------------------------- TRWPWindow implementation ------------------}
  180.  
  181. constructor TRWPWindow.Init(AParent:PWIndowsObject; ATitle:PChar);
  182. begin
  183.   TMDIWindow.Init('RWP Application', LoadMenu(HInstance,
  184.     MakeIntResource(men_Main)));
  185.   BmpStatusBar := LoadBitmap(HInstance, MakeIntResource(bmp_StatusBar));
  186.   BmpStatusLine := 0;
  187. end;
  188.  
  189. procedure TRWPWindow.AboutRWP(var Msg:TMessage);
  190. begin
  191.   Application^.ExecDialog(New(PRWPDialog, Init(@Self, MakeIntResource(dlg_About))));
  192. end;
  193.  
  194. procedure TRWPWindow.BlastStatusLine(PaintDC: HDC);
  195. var
  196.   ClientRect: TRect;
  197.   MemDC: HDC;
  198.   OldBmp: THandle;
  199. begin
  200.   GetClientRect(HWindow, ClientRect);
  201.   MemDC := CreateCompatibleDC(PaintDC);
  202.   OldBmp := SelectObject(MemDC, BmpStatusLine);
  203.   with ClientRect do
  204.   begin
  205.     BitBlt(PaintDC, 0, Bottom - StatusLineHeight, ClientRect.Right,
  206.       StatusLineHeight, MemDC, 0, 0, SrcCopy);
  207.     SelectObject(MemDC, BmpStatusBar);
  208.     BitBlt(PaintDC, 40, Bottom - StatusLineHeight, 10, StatusLineHeight,
  209.       MemDC, 0, 0, SrcCopy);
  210.     BitBlt(PaintDC, 100, Bottom - StatusLineHeight, 10, StatusLineHeight,
  211.       MemDC, 0, 0, SrcCopy);
  212.     BitBlt(PaintDC, TextStart, Bottom - StatusLineHeight, 10, StatusLineHeight,
  213.       MemDC, 0, 0, SrcCopy);
  214.   end;
  215.   SelectObject(MemDC, OldBmp);
  216.   DeleteDC(MemDC);
  217. end;
  218.  
  219. procedure TRWPWindow.DefCommandProc(var Msg: TMessage);
  220. var
  221.   DC: HDC;
  222. begin
  223.   TMDIWindow.DefCommandProc(Msg);
  224.   if CurrentPopup <> 0 then
  225.   begin
  226.     CurrentPopup := 0;
  227.     CurrentID := 0;
  228.     DC := GetDC(HWindow);
  229.     BlastStatusLine(DC);
  230.     ReleaseDC(HWindow, DC);
  231.   end;
  232. end;
  233.  
  234. procedure TRWPWindow.DefWndProc(var Msg: TMessage);
  235. begin
  236.   TMDIWindow.DefWndProc(Msg);
  237.   if Msg.Message = wm_DrawStatusLine then WMDrawStatusLine(Msg);
  238. end;
  239.  
  240. procedure TRWPWindow.Destroy;
  241. begin
  242.   DeleteObject(BmpStatusLine);
  243.   DeleteObject(BmpStatusBar);
  244.   TMDIWindow.Destroy;
  245. end;
  246.  
  247. procedure TRWPWindow.FileNew(var Msg:TMessage);
  248. var
  249.   FileName: array[0..128] of Char;
  250.   FileType: Integer;
  251. begin
  252.   if Application^.ExecDialog(New(PFileNew,
  253.     Init(@Self, FileType))) = id_OK then OpenAFile(FileType, 'Noname')
  254. end;
  255.  
  256. procedure TRWPWindow.FileOpen(var Msg:TMessage);
  257. var
  258.   FileName: array[0..128] of Char;
  259.   FileType: Integer;
  260. begin
  261.   if Application^.ExecDialog(New(PFileOpen,
  262.     Init(@Self, FileType, FileName, FileName))) = id_OK then
  263.     OpenAFile(FileType,FileName)
  264. end;
  265.  
  266. procedure TRWPWindow.FilePrint(var Msg:TMessage);
  267. begin
  268.   if Application^.ExecDialog(New(PRWPDialog,
  269.     Init(@Self,MakeIntResource(dlg_Print)))) = id_OK then
  270. {$ifdef BWCC}
  271.     BWCCMessageBox(HWindow,'Feature not implemented','Print',mb_OK or mb_IconHand);
  272. {$else}
  273.     MessageBox(HWindow,'Feature not implemented','Print',mb_OK or mb_IconHand);
  274. {$endif}
  275. end;
  276.  
  277. procedure TRWPWindow.FileQuit(var Msg: TMessage);
  278. begin
  279.   CloseWindow;
  280. end;
  281.  
  282. function TRWPWindow.GetClassName: PChar;
  283. begin
  284.   GetClassName := 'RWPWindow';
  285. end;
  286.  
  287. procedure TRWPWindow.GetWindowClass(var WndClass: TWndClass);
  288. begin
  289.   TMDIWindow.GetWindowClass(WndClass);
  290.   WndClass.HIcon := LoadIcon(HInstance, MakeIntResource(ico_RWPDemo));
  291.   WndClass.HBrBackground := color_AppWorkspace + 1;
  292. end;
  293.  
  294. procedure TRWPWindow.OpenAFile(FileType: Integer; FileName: PChar);
  295. begin
  296.   with PRWPApplication(Application)^ do
  297.     case FileType of
  298.       ScribbleWindow:
  299.         MakeWindow(new(PScribbleWindow, Init(@Self, FileName)));
  300.       FileWindow:
  301.         MakeWindow(new(PEditWindow, Init(@Self, FileName)));
  302.       GraphWindow:
  303.         MakeWindow(new(PGraphWindow, Init(@Self, FileName)));
  304.     end;
  305. end;
  306.  
  307. procedure TRWPWindow.OptionsDirectories(var Msg:TMessage);
  308. begin
  309.   RunDialog(new(PDlgDirectories,
  310.     Init(@Self, MakeIntResource(dlg_Options_Directories))), 'Directories');
  311. end;
  312.  
  313. procedure TRWPWindow.OptionsMouse(var Msg:TMessage);
  314. begin
  315.   RunDialog(new(PRWPDialog,
  316.     Init(@Self, MakeIntResource(dlg_MouseDialog))), 'Mouse');
  317. end;
  318.  
  319. procedure TRWPWindow.OptionsOpen(var Msg:TMessage);
  320. begin
  321. {
  322.   RunDialog(new(PRWPDialog,
  323.     Init(@Self, MakeIntResource(dlg_Options_Open))), 'Options Open');
  324. }
  325. end;
  326.  
  327. procedure TRWPWindow.OptionsPreferences(var Msg:TMessage);
  328. begin
  329.   RunDialog(new(PRWPDialog,
  330.     Init(@Self, MakeIntResource(dlg_Preferences))), 'Preferences');
  331. end;
  332.  
  333. procedure TRWPWindow.OptionsSave(Var Msg: TMessage);
  334. begin
  335.   PRWPApplication(Application)^.WriteProfileInfo;
  336. end;
  337.  
  338. procedure TRWPWindow.OptionsSaveAs(var Msg:TMessage);
  339. begin
  340. {
  341.   RunDialog(new(PRWPDialog,
  342.     Init(@Self,MakeIntResource(dlg_Options_SaveAs))), 'Options SaveAs');
  343. }
  344. end;
  345.  
  346. procedure TRWPWindow.Paint(PaintDC: HDC; var PaintInfo: TPaintStruct);
  347. begin
  348.   TMDIWindow.Paint(PaintDC, PaintInfo);
  349.   BlastStatusLine(PaintDC);
  350. end;
  351.  
  352. procedure TRWPWindow.RunDialog(ADialog: PRWPDialog; ACaption: PChar);
  353. begin
  354.   if Application^.ExecDialog(ADialog) = id_Ok then
  355.     MessageBox(HWindow, 'Feature not implemented', ACaption, mb_OK);
  356. end;
  357.  
  358. procedure TRWPWindow.WindowArrangeIcons(var Msg: TMessage);
  359. begin
  360.   ArrangeIcons;
  361. end;
  362.  
  363. procedure TRWPWindow.WindowCascade(var Msg: TMessage);
  364. begin
  365.   CascadeChildren;
  366. end;
  367.  
  368. procedure TRWPWindow.WindowCloseAll(var Msg: TMessage);
  369. begin
  370.   CloseChildren;
  371. end;
  372.  
  373. procedure TRWPWindow.WindowTile(var Msg: TMessage);
  374. begin
  375.   TileChildren;
  376. end;
  377.  
  378. procedure TRWPWindow.WMDrawStatusLine(var Msg: TMessage);
  379. var
  380.   DC: HDC;
  381.   Rect: TRect;
  382.   Str: array[0..128] of Char;
  383.   StrID: Integer;
  384.   Lf: TLogFont;
  385.   hSmall, hOld: HFont;
  386.   TextHeight: Integer;
  387. begin
  388.   if CurrentID <> 0 then
  389.   begin
  390.     case CurrentID of
  391.       cm_New: StrID := sth_FileNew;
  392.       cm_Open: StrID := sth_FileOpen;
  393.       cm_Save: StrID := sth_FileSave;
  394.       cm_SaveAs: StrID := sth_FileSaveAs;
  395.       cm_Print: StrID := sth_FilePrint;
  396.       cm_Exit: StrID := sth_FileExit;
  397.       cm_Undo: StrID := sth_EditUndo;
  398.       cm_Cut: StrID := sth_EditCut;
  399.       cm_Copy: StrID := sth_EditCopy;
  400.       cm_Paste: StrID := sth_EditPaste;
  401.       cm_Delete: StrID := sth_EditDelete;
  402.       cm_Clear: StrID := sth_EditClear;
  403.       cm_Options_Open: StrID := sth_OptionsOpen;
  404.       cm_all: StrID := sth_ViewAll;
  405.       cm_By: StrID := sth_ViewBy;
  406.       cm_Some: StrID := sth_ViewSome;
  407.       cm_Directories: StrID := sth_OptionsDirectory;
  408.       cm_Options_Save: StrID := sth_OptionsSave;
  409.       cm_Options_SaveAs: StrID := sth_OptionsSaveAs;
  410.       cm_Preferences: StrID := sth_EnvironmentPreferences;
  411.       cm_Mouse: StrID := sth_EnvironmentMouse;
  412.       cm_Tile: StrID := sth_WindowTile;
  413.       cm_Cascade: StrID := sth_WindowCascade;
  414.       cm_ArrangeIcons: StrID := sth_WindowArrange;
  415.       cm_CloseAll: StrID := sth_WindowCloseAll;
  416.       cm_Index: StrID := sth_HelpIndex;
  417.       cm_Topic_Search: StrID := sth_HelpTopic;
  418.       cm_Glossary: StrID := sth_HelpGlossary;
  419.       cm_Using_Help: StrID := sth_HelpUsing;
  420.       cm_About_RWP: StrID := sth_HelpAbout;
  421.       else
  422.         Exit;
  423.     end
  424.   end
  425.   else
  426.   if CurrentPopup <> 0 then
  427.   begin
  428.     case GetMenuItemID(CurrentPopup, 0) of
  429.       FileFirst: StrID := sth_File;
  430.       EditFirst: StrID := sth_Edit;
  431.       ViewFirst: StrID := sth_View;
  432.       WindowFirst: StrID := sth_Window;
  433.       OptionFirst: StrID := sth_Option;
  434.       EnvironmentFirst: StrID := sth_OptionsEnvironment;
  435.       HelpFirst: StrID := sth_Help;
  436.       else
  437.         Exit;
  438.     end;
  439.   end;
  440.  
  441.   DC := GetDC(HWindow);
  442.   BlastStatusLine(DC);
  443.   if (CurrentPopup <> 0) or (CurrentID <> 0) then
  444.   begin
  445.     { get a slightly smaller font }
  446.  
  447.     hOld := GetStockObject( ANSI_VAR_FONT);
  448.     if ( hOld <> 0) then
  449.     begin
  450.       GetObject( hOld, sizeof( TLogFont), @lf );
  451.       if ( lf.lfHeight > 3) then
  452.     lf.lfHeight := lf.lfHeight - 3;
  453.       lf.lfWidth := 0;
  454.       hSmall := CreateFontIndirect(lf);
  455.     end
  456.     else
  457.       hSmall := 0;
  458.     if ( hSmall <> 0) then
  459.       hOld := SelectObject( DC, hSmall)
  460.     else
  461.       hOld := 0;
  462.     LoadString(HInstance, StrID, Str, Sizeof(Str));
  463.     GetClientRect(HWindow, Rect);
  464.     SetBKColor(DC, RGB(192, 192, 192));
  465.     TextHeight :=  HiWord( GetTextExtent( DC, Str, 1) );
  466.     TextOut(DC, TextStart+10,
  467.       Rect.bottom - StatusLineHeight + ( ( StatusLineHeight - TextHeight ) div 2),
  468.       Str, strlen(Str));
  469.   end;
  470.   ReleaseDC(HWindow, DC);
  471. end;
  472.  
  473. procedure TRWPWindow.WMMenuSelect(var Msg: TMessage);
  474. var
  475.   CurrentMenu: HWnd;
  476.   Str: array[0..20] of Char;
  477. begin
  478.   if Msg.LParamLo = $FFFF then
  479.   begin
  480.     CurrentPopup := 0;
  481.     CurrentID := 0;
  482.   end
  483.   else
  484.   if (Msg.LParamLo and mf_Popup) <> 0 then
  485.   begin
  486.    CurrentPopup := Msg.WParam;
  487.     CurrentID := 0;
  488.   end
  489.   else
  490.     CurrentID := Msg.WParam;
  491.   PostMessage(HWindow,wm_DrawStatusLine, 0, 0);
  492. end;
  493.  
  494. procedure TRWPWindow.WMEnterIdle(var Msg: TMessage);
  495. begin
  496.  if ( Msg.WParam = Msgf_DialogBox) and ( ( GetKeyState( Vk_F1) and $8000) <> 0) then
  497.  begin
  498. {$ifdef BWCC}
  499.    SendMessage( Msg.LParamLo, wm_Command, IdHelp, 0);
  500. {$else}
  501.    SendMessage( Msg.LParamLo, wm_Command, Id_Help, 0);
  502. {$endif}
  503.  end
  504.  
  505. end;
  506.  
  507. procedure TRWPWindow.WMSize(var Msg: TMessage);
  508. var
  509.   Bmp: HBitmap;
  510.   DC: HDC;
  511.   DestDC: HDC;
  512.   OldSrc: HBitmap;
  513.   OldDest: HBitmap;
  514.   Rect: TRect;
  515.   SrcDC: HDC;
  516. begin
  517.   TMDIWindow.WMSize(Msg);
  518.   GetClientRect(HWindow, Rect);
  519.   MoveWindow(ClientWnd^.HWindow, 0, 0, Rect.Right,
  520.     Rect.Bottom - StatusLineHeight,True);
  521.   InvalidateRect(HWindow, nil, True);
  522.   DC := GetDC(HWindow);
  523.   SrcDC := CreateCompatibleDC(DC);
  524.   DestDC := CreateCompatibleDC(DC);
  525.   ReleaseDC(HWindow, DC);
  526.  
  527.   Bmp := LoadBitmap(HInstance, MakeIntResource(bmp_StatusLine));
  528.   OldSrc := SelectObject(SrcDC, Bmp);
  529.   if BmpStatusLine <> 0 then
  530.     DeleteObject(BmpStatusLine);
  531.   BmpStatusLine := CreateCompatibleBitmap(DC, Rect.Right, StatusLineHeight);
  532.   OldDest := SelectObject(DestDC, BmpStatusLine);
  533.   BitBlt(DestDC, 0, 0, 5, StatusLineHeight, SrcDC, 0, 0, srcCopy);
  534.   StretchBlt(DestDC, 5, 0, Rect.Right - 5, StatusLineHeight,
  535.              SrcDC, 6, 0, 20, StatusLineHeight, srcCopy);
  536.   BitBlt(DestDC, Rect.Right - 5, 0, 5, StatusLineHeight, SrcDC, 59, 0, srcCopy);
  537.   SelectObject(SrcDC, OldSrc);
  538.   SelectObject(DestDC, OldDest);
  539.   DeleteDC(SrcDC);
  540.   DeleteDC(DestDC);
  541.   DeleteObject(Bmp);
  542. end;
  543.  
  544. var
  545.   RWPApp:RWPApplication;
  546.  
  547. begin
  548.   RWPApp.Init(AppName);
  549.   RWPApp.Run;
  550.   RWPApp.Done;
  551. end.
  552.