unit2.pas

来自「一个以前写的东东」· PAS 代码 · 共 61 行

PAS
61
字号
unit Unit2;

interface

uses
Windows, Messages,Dialogs,Forms,ShellApi, Graphics, Classes, Controls, ExtCtrls, StdCtrls,Registry;

type
  TForm2 = class(TForm)
    Image1: TImage;
    Button1: TButton;
    Image2: TImage;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure Image1Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Image1Click(Sender: TObject);
var
    Registro: TRegistry;
begin
  Registro:= TRegistry.Create;
  Registro.RootKey := HKEY_LOCAL_MACHINE;
  if Registro.KeyExists('SOFTWARE\Tencent\QQ') then
  begin
  ShellExecute(GetDesktopWindow(),
                nil,
                //pchar('http://wpa.qq.com/msgrd?V=1&Uin=743510&Site=多国语言在线翻译V1.0&Menu=yes'),
                pchar('Tencent://Message/?Menu=yes&Uin=743510&websiteName=多国语言在线翻译V1.0'),
                nil,
                nil,
                SW_SHOWNORMAL);
  end else
  begin
   showmessage('您的电脑上没有安装QQ,请先安装QQ!');
   exit;
  end;

end;

procedure TForm2.Button1Click(Sender: TObject);
begin
Form2.Close;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?