热键问题(100分)

  • 主题发起人 主题发起人 yaojian01
  • 开始时间 开始时间
Y

yaojian01

Unregistered / Unconfirmed
GUEST, unregistred user!
怎样无论系统运行进程,按ctrl+d都可调用一个叫zt.exe的可执行文件!请各位指教!
 
unit Unit1;<br><br>interface<br><br>uses<br>&nbsp; Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br>&nbsp; StdCtrls;<br><br>type<br>&nbsp; TForm1 = class(TForm)<br>&nbsp; &nbsp; procedure FormCreate(Sender: TObject);<br>&nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; &nbsp; procedure WMHotKey(var Message: TMessage); message WM_HOTKEY;<br>&nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; end;<br><br>var<br>&nbsp; Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TForm1.WMHotKey(var Message: TMessage); <br>begin <br>&nbsp; application.Restore; <br>&nbsp; application.bringtofront; <br>&nbsp; WinExec('notepad.exe',SW_SHOW);<br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br>&nbsp; RegisterHotKey(form1.Handle,123,mod_control,ord('D'));<br>end;<br><br>end.
 
DELPHI有个热键控制,操作就可以定义全局热键
 

Similar threads

后退
顶部