Delphi编程之系统OEM DIY


本文整理自网络,侵删。

 

//转载请注明出处

unit Unit1;

 

interface

 

uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

  Dialogs, ExtCtrls, StdCtrls, ExtDlgs,Registry;

 

type

  TForm1 = class(TForm)

    GroupBox1: TGroupBox;

    Label1: TLabel;

    Edit1: TEdit;

    Label2: TLabel;

    Edit2: TEdit;

    Label3: TLabel;

    Edit3: TEdit;

    Label4: TLabel;

    Edit4: TEdit;

    Button1: TButton;

    GroupBox2: TGroupBox;

    Button2: TButton;

    Button3: TButton;

    Button4: TButton;

    Button5: TButton;

    Button6: TButton;

    Label6: TLabel;

    Edit5: TEdit;

    Label7: TLabel;

    Edit6: TEdit;

    OpenPictureDialog1: TOpenPictureDialog;

    Image1: TImage;

    Label5: TLabel;

    procedure Button1Click(Sender: TObject);

    procedure Button2Click(Sender: TObject);

    procedure Button3Click(Sender: TObject);

    procedure Button5Click(Sender: TObject);

    procedure Button6Click(Sender: TObject);

    procedure Button4Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

 

procedure TForm1.Button1Click(Sender: TObject);

begin

if (Edit1.Text='') and (Edit2.Text='') and (Edit3.Text='') and (Edit4.Text='') and (Edit5.Text='') then

MessageBox(0,'您还没有填写相关信息呢!','提示信息',64)

else

Edit1.Clear;

Edit2.Clear;

Edit3.Clear;

Edit4.Clear;

Edit5.Clear

end;

 

procedure TForm1.Button2Click(Sender: TObject);

begin

if OpenPictureDialog1.Execute then

Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);

Edit6.Text:= ExtractFileDir(OpenPictureDialog1.FileName)+'\'+ExtractFileName(OpenPictureDialog1.FileName);

end;

 

procedure TForm1.Button3Click(Sender: TObject);

begin

if Image1.Picture.Bitmap.Empty then

MessageBox(0,'您还没有载入图片呢!','提示信息',64)

else

Image1.Picture.Bitmap:=nil;

end;

 

procedure TForm1.Button4Click(Sender: TObject);

begin

MessageBox(0,'作者:过往云霄 QQ:154103651'+#13+#13'操作系统:Windows 10简体中文专业版64位'+#13+#13'编程工具:Delphi 2010英文架构师版','提示信息',64);

end;

 

procedure TForm1.Button5Click(Sender: TObject);

var

Reg:TRegistry;

begin

Reg:=TRegistry.Create;

try

  Reg.Access:=KEY_WOW64_64KEY or KEY_WRITE;

  Reg.RootKey:=HKEY_LOCAL_MACHINE;

  if Reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation',True) then

  begin

    Reg.WriteString('Manufacturer',Edit1.Text);

    Reg.WriteString('Model',Edit2.Text);

    Reg.WriteString('SupportHours',Edit3.Text);

    Reg.WriteString('SupportPhone',Edit4.Text);

    Reg.WriteString('SupportURL',Edit5.Text);

    //Reg.WriteString('Logo',ExtractFileName(OpenPictureDialog1.FileName));  获得文件名称

     Reg.WriteString('Logo',ExtractFileDir(OpenPictureDialog1.FileName)+'\'+ExtractFileName(OpenPictureDialog1.FileName));

    Reg.CloseKey;

  end;

finally

Reg.Free;

end;

end;

 

procedure TForm1.Button6Click(Sender: TObject);

begin

Close;

end;

 

end.

 

来源:https://www.cnblogs.com/guowangyunxiao/p/5287408.html

相关阅读 >>

Delphi tmemo控件滚动条scrollbar末尾插入字符串一点都会闪烁的轻松实现

Delphi 禁止截屏printscreen

Delphi怎么实现一定范围内的随机数呢?

Delphi滚动窗口标题

Delphi readln 读取一行文本

Delphi 不管什么datetime日期格式时间格式转换都不会错了

Delphi使用正则匹配网页数据

github上通过星级评估排名前10的最受欢迎的开源Delphi项目

Delphi 截取某个字符之前的字段

Delphi 中的包开发

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...