易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi关联文件扩展名

unit unitMain;
interface
uses
Registry, shlobj,
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TExtForm = class(TForm)
ledExtension: TLabeledEdit;
ledAssocApp: TLabeledEdit;
GetAssocApp: TButton;
AssocThisButton: TButton;
procedure FormCreate(Sender: TObject);
procedure AssocThisButtonClick(Sender: TObject);
procedure GetAssocAppClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ExtForm: TExtForm;
implementation
{$R *.dfm}
function GetExeByExtension(sExt : string) : string;
var
sExtDesc:string;
begin
with TRegistry.Create do
begin
try
RootKey:=HKEY_CLASSES_ROOT;
if OpenKeyReadOnly(sExt) then
begin
sExtDesc:=ReadString('') ;
CloseKey;
end;
if sExtDesc <>'' then
begin
if OpenKeyReadOnly(sExtDesc + '\Shell\Open\Command') then
begin
Result:= ReadString('') ;
end
end;
finally
Free;
end;
end;
if Result <> '' then
begin
if Result[1] = '"' then
begin
Result:=Copy(Result,2,-1 + Pos('"',Copy(Result,2,MaxINt))) ;
end
end;
end;
procedure RegisterFileType(ExtName:String; AppName:String) ;
var
reg:TRegistry;
begin
reg := TRegistry.Create;
try
reg.RootKey:=HKEY_CLASSES_ROOT;
reg.OpenKey('.' + ExtName, True) ;
reg.WriteString('', ExtName + 'file') ;
reg.CloseKey;
reg.CreateKey(ExtName + 'file') ;
reg.OpenKey(ExtName + 'file\DefaultIcon', True) ;
reg.WriteString('', AppName + ',0') ;
reg.CloseKey;
reg.OpenKey(ExtName + 'file\shell\open\command', True) ;
reg.WriteString('',AppName+' "%1"') ;
reg.CloseKey;
finally
reg.Free;
end;
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil) ;
end;
procedure TExtForm.FormCreate(Se


相关文档:

delphi发送焦点移动消息的函数及参数


procedure TForm_BaseMDI.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then
     begin
     Key := #0;
     SendMessage(Handle, 48384, 9, 0);     
     end;
end; ......

Delphi的命令行编译命令

Borland出品的Delphi,有着闪电般的编译速度,但是在界面控件使用较多、工程项目较大的时候,编译一个工程仍需要一段时间,打开庞大的Delphi IDE,也需要时间。其实,在一个工程开发结束,调试完成之后的Release编译,完全可以用命令行来执行,因为Delphi的编译器参数不像C++编译器那样复杂。
  笔者把Delphi联机手册 ......

delphi引入ActiveX控件报coreide70.bpl错误解决办法

    今天在大理剑川做监控联网工程,遇到2台DIY的PC-DVR,联网很不顺利。机器的软件是盗版破解的,只破解了服务器端,客户端未破解,还有就是版本也不对。最后发现软件下有一ActiveX控件可以做联网使用,于是想把这个OCX引入项目软件工程。在引入的时候delphi提示coreide70.bpl报错,错误代码:00000019 ......

Delphi文件操作

 unit unitFileOP;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
implementation
function GetSys32Dir:String;
var
Sys32Dir: string;
pSys32Dir: array[0..Max_Path] of char;
begin
GetSystemDirectory(pSys32Dir,Max_Pat ......

Delphi实现透明窗体

unit unitMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号