home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pcmagazi / 1992 / 20 / ln1120 / test3.pas < prev    next >
Pascal/Delphi Source File  |  1992-07-30  |  1KB  |  48 lines

  1. {
  2. Title:  TEST3.PAS
  3. Caption:This small program is the test platform for the TBWCCFilDlg, which
  4. customizes the Open common dialog with BWCC controls.
  5. }
  6.  
  7. program Test3;
  8.  
  9. uses winprocs, wintypes, wobjects, strings, commdlg, custom2;
  10.  
  11. {$R Test3}
  12.  
  13. type
  14.  
  15.   TMyApp = object(TApplication)
  16.     procedure InitMainWindow; virtual;
  17.   end;
  18.  
  19.   PMyMainWindow = ^TMyMainWindow;
  20.   TMyMainWindow = object(TMDIWindow)
  21.     procedure cmFileOpen(var Msg: TMessage); virtual cm_First + 101;
  22.   end;
  23.  
  24. procedure TMyMainWindow.cmFileOpen(var Msg: TMessage);
  25. var
  26.   FileName: array [0..79] of Char;
  27.   Result: Integer;
  28. begin
  29.   StrCopy(FileName, '*.pas');
  30.   Result := Application^.ExecDialog(new(PBWCCFileDlg,
  31.         Init(@Self, OFN_FileMustExist, Filename, SizeOf(Filename))));
  32.   if Result = idOk then                     
  33.     MessageBox(HWindow, Filename, 'You selected', mb_OK);
  34. end;
  35.  
  36. procedure TMyApp.InitMainWindow;
  37. begin
  38.   MainWindow := new(PMyMainWindow, Init('Test CommDlg',
  39.                      LoadMenu(HInstance, 'MainMenu')));
  40. end;
  41.  
  42. var MyApp: TMyApp;
  43. begin
  44.   MyApp.Init('TestCommDlg');
  45.   MyApp.Run;
  46.   MyApp.Done;
  47. end.
  48.