delphi模仿实现autohotkey的部分功能

delphi模仿实现autohotkey的部分功能

 

;ahk源代码

Hotkey,F1,unitMsgBox

return

unitMsgBox()

{

MsgBox,按快捷键{F1}时执行的代码

}

 

仿制的delphi源代码-(Delphi7_Lite_Full_Edition_Setup_7.3.4.3_Build_20110801)

 

当不知道如何写delphi代码时可以进行以下操作:

 

查找代码操作1:

用FileLocator Pro到群晖NAS中全文搜索自己平时分类整理的源代码

delphi模仿实现autohotkey的部分功能

 

 

查找代码操作2:

到百度或者360搜索中输入关键字并搜索一下。

delphi模仿实现autohotkey的部分功能

查找代码操作3:

通过腾讯QQ向学习编程的好友求助。

delphi模仿实现autohotkey的部分功能

查找代码操作4:

请在“西瓜视频”、“抖音短视频”、“优酷视频”、“腾讯视频”、“爱奇艺视频”、“搜狐视频”、“芒果TV”、“PP视频”、“百搜视频”、“乐视视频”、“咪咕视频”、“土豆视频”、“风行视频”或者“小米视频”安卓应用软件APP之中搜索关键字“delphi”或者您感兴趣的其他类似关键字并搜索相关视频,看看别人是如何折腾源代码的。

delphi模仿实现autohotkey的部分功能

查找代码操作5:

登录自制的delphi源代码总库,并全文搜索源代码数据库总库。

(基于Embarcadero Delphi 10.4 Sydney和Microsoft SQL Server数据库和多个DELL二手旧服务器制作的用于存放程序源代码的超大型数据库外网远程访问查询服务(源代码总容量已经超过50GB,有的源代码是自己写的,有的源代码是因特网上下载后分类整理的,有的源代码是随书光盘中复制的,有的源代码是淘宝网上花重金购买的),源代码和相关资源(源代码所需的INI配置文件、数据库文件、数据库备份文件、文档、表格、图片、皮肤、声音、动画、视频等等都打包在一起)以SQL记录对象的形式打包保存在服务器上并实时异地同步数据,防止丢失数据)

数据库的性能可能要比Windows的文件系统更加好一点,而且无需手动索引,真正实现高速高效的闪电式全文内容搜索和自动化复制粘贴测试和代码质量评估。

 

delphi模仿实现autohotkey的部分功能

给TA捐赠
共{{data.count}}人
人已捐赠
其他案例

外网远程顶级域名连接群晖的WebDAV文件服务映射盘符

2020-9-14 16:34:37

其他

rem 脚本名称:增强KeePass密码管理的批处理脚本

2020-9-21 19:03:55

6 条回复 A文章作者 M管理员
  1. aahk

    软件和硬件互相配合,组件一个超级大的全文搜索的编程知识库、资源总库和总的源代码库。

  2. aahk

    如何在sql server中检索和存储音频和视频?(how can retrieve and store audio and video in sql server?)

  3. aahk

    Delphi全局快捷键的功能注册

    全局快捷键就是程序窗口失去焦点时也管用的快捷键

    1.在窗启动时创建ATOM;(aatom:ATOM;定义在private中)

    if FindAtom(‘ZWXHotkey’)=0 then
    begin
    aatom:=GlobalAddAtom(‘ZWXHotkey’);
    end;
    if RegisterHotkey(Handle,aatom,MOD_ALT,$41) then
    begin
    MessageBox(Handle,’按alt+a’,’提示’,MB_OK);
    end;

    2.定义处理热键的消息过程(定义在private中,下面二个处理消息的过程是一样的)

    procedure Hotkey(var msg:TMessage);message WM_Hotkey;//定义全局热键消息事件
    //procedure Hotkey2(var msg:TWMHotkey);message WM_Hotkey;//同上

    3.消息过程的处理(下面二个IF任选一个即可,如果msg在步骤2定义成TWMHotkey,则不用转换)

    procedure TForm2.Hotkey(var msg: TMessage);
    begin
    if TWMHotkey(msg).Hotkey=aatom then
    begin
    //ShowMessage(‘s’);
    end;
    if (msg.LParamHi=$41) and (msg.LParamLo=MOD_ALT) then
    begin
    //處理事情
    //ShowMessage(‘按快捷键 {Alt} + a 时执行的代码’);
    end;
    end;

    4.程序关闭时,刪除热键和原子

    procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
    begin
    UnregisterHotKey(Handle,aatom);
    GlobalDeleteAtom(aatom);
    end;

  4. aahk

    全局快捷键就是程序窗口失去焦点时或者窗口隐藏时或者窗口不存在时(此时只有进程没有窗口)也管用的快捷键,除非关闭进程否则一直有效的快捷键。

  5. aahk

    Embarcadero.Delphi.10.4.v27.0.37889.9797.Lite.v16.0

  6. aahk

    // Embarcadero.Delphi.10.4.v27.0.37889.9797.Lite.v16.0

    unit Unit1;

    interface

    uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
    System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs;

    type
    TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    private
    { Private declarations }
    procedure Hotkey(var msg: TMessage); message WM_Hotkey; // 定义全局热键消息事件
    // procedure Hotkey2(var msg:TWMHotkey);message WM_Hotkey;//同上
    public
    { Public declarations }
    end;

    var
    Form1: TForm1;
    aatom: Word;

    implementation

    {$R *.dfm}

    procedure TForm1.FormCreate(Sender: TObject);
    begin
    if FindAtom(‘ZWXHotkey’) = 0 then
    begin
    aatom := GlobalAddAtom(‘ZWXHotkey’);
    end;
    if RegisterHotkey(Handle, aatom, MOD_ALT, $41) then
    begin
    // MessageBox(Handle, ‘按alt+a’, ‘提示’, MB_OK);
    end;
    SetWindowPos(Handle, HWND_TOPMOST, 100, 100, 200, 200, SWP_SHOWWINDOW);
    end;

    procedure TForm1.Hotkey(var msg: TMessage);
    begin
    if TWMHotkey(msg).Hotkey = aatom then
    begin
    // MessageBox(Handle, ‘按alt+a’, ‘提示’, MB_OK);
    end;
    if (msg.LParamHi = $41) and (msg.LParamLo = MOD_ALT) then
    begin
    // 處理事情
    // ShowMessage(‘按快捷键 {Alt} + a 时执行的代码’);
    SetWindowPos(Handle, HWND_TOPMOST, 100, 100, 200, 200, SWP_SHOWWINDOW);
    MessageBox(Handle, ‘您按下了快捷键{Alt} + A’, ‘提示’, MB_OK);
    // ShowWindow(Handle,sw_shownoactivate);
    // ShowWindow(Application.Handle,sw_shownoactivate);
    // SetWindowPos(窗口句柄,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOV OR SWP_NOSIZE OR SWP_SHOWWINDOW);
    end;
    end;

    procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
    begin
    UnregisterHotKey(Handle, aatom);
    GlobalDeleteAtom(aatom);
    end;

    end.

个人中心
购物车
优惠劵
有新私信 私信列表
搜索