DELPHI 外挂源码
适合初学者
源代码在线查看: unit1.~pas
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
HotkeyF1,HotKeyF2:integer;
procedure WMHotkeyHandle(var Msg: TMessage); message WM_HOTKEY;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
{ TForm1 }
//比较两个字符串是否相同
function WooolCompareStr(s1, s2: string): Boolean;
begin
result := False;
if (Length(s1) < 8) or (Length(s2) < 8) then exit; //判断s1,s2长度小于不小于8
result := (s1[1] = s2[1]) and (s1[2] = s2[2]) and (s1[3] = s2[3]) and (s1[4] = s2[4]) and
(s1[5] = s2[5]) and (s1[6] = s2[6]) and (s1[7] = s2[7]) and (s1[8] = s2[8]);
end;
{ TForm1 }
procedure TForm1.WMHotkeyHandle(var Msg: TMessage);
begin
if Msg.WParam=HotkeyF1 then
ShowMessage('alt+F1');
if Msg.WParam=HotkeyF2 then
//ShowMessage('ctrl+q');
Form2.ShowModal;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
HotKeyF1:=GlobalAddAtom(pchar('UserDefinsHotKey1'))-$C000;
RegisterHotKey(Form1.Handle,HotKeyF1,MOD_ALT ,VK_F1); //alt+F1
HotkeyF2:=GlobalAddAtom(pchar('UserDefinsHotKey2'))-$C000;
RegisterHotKey(Form1.Handle,HotkeyF2, MOD_CONTROL ,ord('Q')); //ctrl+q
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnregisterHotKey(Form1.Handle,1);
DeleteAtom(HotkeyF1);
DeleteAtom(HotkeyF2);
end;
end.
|
相关资源 |
|
-
DELPHI 外挂源码
适合初学者
-
智能交通系统演示delphi源码,适合初学者看的例子
-
实现定时关机功能的delphi源码,适合初学者
-
flash个各式各样的鸟类源码 适合初学者 学习 简单易懂~
-
AJAX源码,适合初学者上手,一共有3个源码,循序渐进的学习AJAX,这是1
-
AJAX源码,适合初学者上手,一共有3个源码,循序渐进的学习AJAX,这是2
-
AJAX源码,适合初学者上手,一共有3个源码,循序渐进的学习AJAX,这是3
-
ATmega的闹钟源码.适合初学者学习AVR的时钟,计数器,中断模块,及数码管控制.
|