RSS订阅 | 匿名投稿
您的位置:网站首页 > Dll > 正文

Delphi解决DLL注入桌面卡的问题

作者:admin 来源:未知 日期:2010/1/27 8:34:31 人气: 标签:

//完整代码

library showDLL;

uses
SysUtils,
Windows,
DateUtils,
Graphics;

var
ThreadHandle : THandle;//声明句柄
ThreadID : DWORD;//线程ID

{判断是否为星期六}
function RequestDate:Boolean;
var
s:Integer;
begin
s := DayOfTheWeek(Now);
if s = 1 then
begin
Result := True;
end
else
Result := False;
end;

{判断是否在八点半后}
function RequestTime:Boolean;
const
x = 13;
y = 54;
var
c,q,r,hm:word; //拆分时间 对比 用亲爱的的名字缩写 怀念呀 呵呵
xianzai:tdatetime; //赋值用 现在时间 用于获取 对比
begin
xianzai := Now;
DecodeTime(xianzai,c,q,r,hm); //拆分时间
if (c >= x) and (q >= y) then
begin
Result := True;
end
else
Result := False;
end;

{整合表演时间}
function IsShowTime:Boolean;
begin
if (RequestDate = True) and (RequestTime = True) then
begin
Result := True;
end
else
Result := False;
end;

//写字到屏幕
procedure WriteScreen(Text :string);
var
Cvs :TCanvas;
// I :Integer;
begin
Cvs := TCanvas.Create;
Cvs.Handle := GetDC(0);
Cvs.Brush.Style := bsClear;
Cvs.Font.Color := clRed;
Cvs.Font.Size := 30;
Cvs.Font.Name := '宋体';
Cvs.Font.Style := [fsBold];
Cvs.TextOut(500,400,Text);
ReleaseDC(0, Cvs.Handle);
Cvs.Free;
end;

function ThreadProc(into:Pointer):Integer;stdcall;
begin
repeat
begin
// MessageBox(0,'Yes','警告',MB_ICONEXCLAMATION);
Sleep(5000);
end;
until IsShowTime = True;
WriteScreen('我爱你。溶溶');
end;

begin
ThreadHandle := CreateThread(nil,0,@ThreadProc,nil,0,ThreadID);
end.
读完这篇文章后,您心情如何?
0
0
0
0
0
0
0
0
本文网址: