home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
DIROUTX.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-28
|
2KB
|
50 lines
//----------------------------------------------------------------------------
//Borland C++Builder
//Copyright (c) 1987, 1997 Borland International Inc. All Rights Reserved.
//----------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "diroutx.h"
//---------------------------------------------------------------------------
#pragma link "sampreg"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::DirectoryOutline1Change(TObject *Sender)
{
FileListBox1->Directory=DirectoryOutline1->Directory;
}
//---------------------------------------------------------------------
void __fastcall TForm1::DriveComboBox1Change(TObject *Sender)
{
DirectoryOutline1->Drive=DriveComboBox1->Drive;
}
//---------------------------------------------------------------------
void __fastcall TForm1::Edit1Change(TObject *Sender)
{
FileListBox1->Mask=Edit1->Text;
}
//---------------------------------------------------------------------
void __fastcall TForm1::FileListBox1Change(TObject *Sender)
{
// put some data in the memo
const int size=1024;
char buffer[size];
memset(buffer,0,size);
HFILE file=_lopen(FileListBox1->FileName.c_str(),OF_READ);
if (file!=NULL) _lread(file,buffer,size);
// nulls will terminate this too soon, so we will
// replace them with '.'
for (int i=0;i<1023;i++) if (buffer[i]==0) buffer[i]='.';
Memo1->Text=AnsiString(buffer);
_lclose(file);
}
//---------------------------------------------------------------------