吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 767|回复: 1
收起左侧

[求助] 为啥报错呢?

[复制链接]
冥界3大法王 发表于 2021-10-2 18:41
[Delphi] 纯文本查看 复制代码
unit 读取写入ini_3;



interface



uses

  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,

  System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,

  Vcl.StdCtrls;



type

  TForm3 = class(TForm)

    GroupBox1: TGroupBox;

    Label6: TLabel;

    Edit1: TEdit;

    Label1: TLabel;

    Edit2: TEdit;

    Label2: TLabel;

    Edit3: TEdit;

    Label3: TLabel;

    Edit4: TEdit;

    Label4: TLabel;

    Edit5: TEdit;

    procedure hotykey(var msg: TMessage); message WM_HOTKEY;

    procedure FormCreate(Sender: TObject);

    procedure FormDestroy(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;



var

  Form3: TForm3;

  idF1: Integer;



implementation



{$R *.dfm}



procedure TForm3.FormDestroy(Sender: TObject);

begin

  UnRegisterHotKey(handle, idF1);

end;



procedure TForm3.hotykey(var msg: TMessage);

var

  F: string;

begin

  if (GetAsyncKeyState(VK_CONTROL) < 0) and (GetAsyncKeyState(VK_SHIFT) < 0) and (GetAsyncKeyState(VK_F1) < 0) then

  begin

//    ShowMessage('Ctrl+Shift+F1');

    F := ActiveControl.Name;

    ShowMessage(F);                                      

    Edit3.Text := F + '_' + Edit3.Text;            ================================》就这里,不设热键也没事发生啊~~ 想不通呢?

  end;

end;



procedure TForm3.FormCreate(Sender: TObject);

begin

  idF1 := GlobalAddAtom('hotkeyF1');

  RegisterHotKey(handle, idF1, MOD_CONTROL + MOD_SHIFT, VK_F1);

end;



end.

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| 冥界3大法王 发表于 2021-10-2 18:43
哈哈,我想明白了。得在主Form1里设用,3号Form没出来,当然烦病了。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-25 23:02

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表