惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
V
Vulnerabilities – Threatpost
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
G
GRAHAM CLULEY
S
Securelist
P
Palo Alto Networks Blog
MongoDB | Blog
MongoDB | Blog
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
WordPress大学
WordPress大学
Project Zero
Project Zero
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
C
Cyber Attacks, Cyber Crime and Cyber Security
F
Fortinet All Blogs
博客园 - 叶小钗
B
Blog RSS Feed
C
Cisco Blogs
Google DeepMind News
Google DeepMind News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers Blog
K
Kaspersky official blog
D
Docker
Latest news
Latest news
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
Cyberwarzone
Cyberwarzone
Security Latest
Security Latest
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Spread Privacy
Spread Privacy
Microsoft Azure Blog
Microsoft Azure Blog
C
Check Point Blog
J
Java Code Geeks
Simon Willison's Weblog
Simon Willison's Weblog
T
Tenable Blog
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog
H
Help Net Security
L
LINUX DO - 热门话题
T
The Exploit Database - CXSecurity.com
Jina AI
Jina AI
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
NISL@THU
NISL@THU
美团技术团队
腾讯CDC

博客园 - DELPHI技术

How to get File Summary Info 动态建表(示例) DBGridEh应用实例(来自delphi园地) DBGrid、DBGrideh专题总结(来自delphi园地) delphi 默认情况下参数及返回值的保存位置 Rotating Text How to Parse a Delimited String Into a String List - DELPHI技术 2005年5月20日Borland Delphi首席科学家Danny Thorpe谈Delphi的未来! 使用动态包导出函数的调用单元完整源代码 使用动态包导出函数的单元的完整源代码 “类引用”概念 创建包 包和DLL的对比 动态包(bpl)的一个窗体源代码 动态调用包(bpl)的窗体源码 Delphi中预想不到的代码 一个完整身份证效验程序 基本算法(用 PASCAL 描述) 公用函数
什么是BPL?在BPL中有多少单元的源代码
DELPHI技术 · 2005-07-16 · via 博客园 - DELPHI技术

DFM File(main.dfm):

object MainForm: TMainForm
  Left = 301
  Top = 163
  Width = 696
  Height = 480
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -16
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 19
  object TreeView: TTreeView
    Left = 0
    Top = 0
    Width = 688
    Height = 453
    Align = alClient
    Indent = 19
    TabOrder = 0
    Items.Data = {
      010000001C0000000000000000000000FFFFFFFFFFFFFFFF0000000000000000
      0342504C}
  end
end

PAS File(main.pas):

unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls, StrUtils, TypInfo;

type
  TMainForm = class(TForm)
    TreeView: TTreeView;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation

{$R *.dfm}

//==============================================================================
//Form.Unit*****************************************************************
//==============================================================================
procedure EnumPackageInfo(const InfoName: string; NameType: TNameType; Flags: Byte; Param: Pointer);
var Node: TTreeNode;
    i: integer;
begin
  Node := nil;
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  with MainForm.TreeView do
  begin
    for i:=1 to Selected.Count do
    if Selected.Item[i-1].Text=GetEnumName(TypeInfo(TNameType), Ord(NameType))
    then Node := Selected.Item[i-1];
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if not Assigned(Node)
    then Node := Items.AddChild(Selected, GetEnumName(TypeInfo(TNameType), Ord(NameType)));
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Items.AddChild(Node, InfoName);
  end;
end;

//==============================================================================
//Form.´´½¨´°Ìå*****************************************************************
//==============================================================================
procedure TMainForm.FormCreate(Sender: TObject);
var SystPath: array[0..128] of char;
    DosError: Integer;
    DirInfo: TSearchRec;
    AppName: string;
    HPack: HModule;
    Flags: Integer;
    Desc: string;
begin
  GetSystemDirectory(SystPath, 128);
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  DosError := FindFirst(SystPath+'\*.*', FaAnyfile, DirInfo);
  while DosError=0 do
  begin
    {$IF DEFINED(WIN32) AND DECLARED(UsingVCL)}
    if ((DirInfo.Attr and FaDirectory)<>FaDirectory) and ((DirInfo.Attr and FaVolumeID)<>FaVolumeID)
    {$ELSE}
    if ((DirInfo.Attr and FaDirectory)<>FaDirectory)
    {$IFEND}
    then if UpperCase(Copy(DirInfo.Name,Pos('.',DirInfo.Name)+1,3))='BPL' then
         try
           Desc := GetPackageDescription(PChar(DirInfo.Name));
           if Desc<>'' then Desc := '......('+ Desc +')';
           TreeView.Items.AddChild(TreeView.Items[0], DirInfo.Name + Desc);
           TreeView.Items[0].Item[TreeView.Items[0].Count-1].Selected := True;
           HPack := LoadPackage(DirInfo.Name);
           GetPackageInfo(HPack, Pointer(@HPack), Flags, EnumPackageInfo);
         except
         end;
    DosError := FindNext(DirInfo);
  end;
  SysUtils.FindClose(DirInfo);
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  AppName := ExtractFileName(Application.ExeName);
  TreeView.SaveToFile(ExtractFilePath(Application.ExeName)+Copy(AppName,1,Pos('.',AppName)-1)+'.txt');
end;

end.