🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4865

Re: FindFirstFile(), FindNextFile() and TreeView

#4865
From: Heinrich Wolf
Date: Sun, 20 Nov 2005 19:30
227 lines
6423 bytes
Hi,

have you already tried the Win31 Controls shipped with C++ Builder?
Here is a sample application without any code lines,
everything created by mouse click and setting properties in the Object 
Inspector.

Regards
Heiner

MyFileOpenDlg.bpr
==============
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
  <MACROS>
    <VERSION value="BCB.05.03"/>
    <PROJECT value="MyFileOpenDlg.exe"/>
    <OBJFILES value="MyFileOpenDlg.obj main.obj"/>
    <RESFILES value="MyFileOpenDlg.res"/>
    <DEFFILE value=""/>
    <RESDEPEN value="$(RESFILES) main.dfm"/>
    <LIBFILES value=""/>
    <LIBRARIES value="VCLX50.lib bcbsmp50.lib VCL50.lib"/>
    <SPARELIBS value="VCL50.lib bcbsmp50.lib VCLX50.lib"/>
    <PACKAGES value="VCL50.bpi VCLX50.bpi bcbsmp50.bpi dclocx50.bpi 
bcb2kaxserver50.bpi"/>
    <PATHCPP value=".;"/>
    <PATHPAS value=".;"/>
    <PATHRC value=".;"/>
    <PATHASM value=".;"/>
    <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
    <RELEASELIBPATH value="$(BCB)\lib\release"/>
    <LINKER value="tlink32"/>
    <USERDEFINES value="_DEBUG"/>
    <SYSDEFINES value="NO_STRICT"/>
    <MAINSOURCE value="MyFileOpenDlg.cpp"/>
    <INCLUDEPATH 
value="C:\Programme\Borland\CBuilder5\Projects\;$(BCB)\include;$(BCB)\include\vcl"/>
    <LIBPATH 
value="C:\Programme\Borland\CBuilder5\Projects\;$(BCB)\lib\obj;$(BCB)\lib"/>
    <WARNINGS value="-w-par"/>
  </MACROS>
  <OPTIONS>
    <CFLAG1 
value="-Od -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- 
 -c
      -tW -tWM"/>
    <PFLAGS value="-$YD -$W -$O- -v -JPHNE -M"/>
    <RFLAGS value=""/>
    <AFLAGS value="/mx /w2 /zd"/>
    <LFLAGS value="-D&quot;&quot; -aa -Tpe -x -Gn -v"/>
  </OPTIONS>
  <LINKER>
    <ALLOBJ value="c0w32.obj sysinit.obj $(OBJFILES)"/>
    <ALLRES value="$(RESFILES)"/>
    <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/>
  </LINKER>
  <IDEOPTIONS>
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1031
CodePage=1252

[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=

[Debugging]
DebugSourceDirs=$(BCB)\source\vcl

[Parameters]
RunParams=
HostApplication=
RemoteHost=
RemotePath=
RemoteDebug=0

[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=0
  </IDEOPTIONS>
</PROJECT>

MyFileOpenDlg.cpp
==============
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
USERES("MyFileOpenDlg.res");
USEFORM("main.cpp", Form1);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
 try
 {
   Application->Initialize();
   Application->CreateForm(__classid(TForm1), &Form1);
   Application->Run();
 }
 catch (Exception &exception)
 {
   Application->ShowException(&exception);
 }
 return 0;
}
//---------------------------------------------------------------------------

main.dfm
======
object Form1: TForm1
  Left = 192
  Top = 114
  Width = 163
  Height = 284
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object DirectoryListBox1: TDirectoryListBox
    Left = 4
    Top = 24
    Width = 145
    Height = 97
    FileList = FileListBox1
    ItemHeight = 16
    TabOrder = 0
  end
  object FileListBox1: TFileListBox
    Left = 4
    Top = 124
    Width = 145
    Height = 97
    FileEdit = Edit1
    ItemHeight = 13
    TabOrder = 1
  end
  object DriveComboBox1: TDriveComboBox
    Left = 4
    Top = 4
    Width = 145
    Height = 19
    DirList = DirectoryListBox1
    TabOrder = 2
  end
  object Edit1: TEdit
    Left = 4
    Top = 224
    Width = 121
    Height = 21
    TabOrder = 3
    Text = '*.*'
  end
end

main.h
=====
//---------------------------------------------------------------------------

#ifndef mainH
#define mainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <FileCtrl.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // Von der IDE verwaltete Komponenten
 TDirectoryListBox *DirectoryListBox1;
 TFileListBox *FileListBox1;
 TDriveComboBox *DriveComboBox1;
 TEdit *Edit1;
private: // Anwender-Deklarationen
public:  // Anwender-Deklarationen
 __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

main.cpp
=======
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
 : TForm(Owner)
{
}
//---------------------------------------------------------------------------
Technical Details
Message-ID: <3uc16hF10gj2rU1@individual.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <437f21f9@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c9219bd94e2094ee
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: "Heinrich Wolf" <invalid@invalid.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: FindFirstFile(), FindNextFile() and TreeView
Date: Sun, 20 Nov 2005 20:30:20 +0100
Lines: 229
Message-ID: <3uc16hF10gj2rU1@individual.net>
References: <437f21f9@newsgroups.borland.com>
X-Trace: individual.net ooW6aZCobBLoSmxhaocAfQS1vHZtvpcviFkvoFZGWumS/B0qve
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response