1.防止刷新时闪烁的终极解决办法
{ 防止刷新时闪烁的终极解决办法(对付双缓冲无效时) }
Perform($000B, 0, 0); //锁屏幕 防止闪烁
// 做一些会发生严重闪烁的事情..
//解锁屏幕并重画
Perform($000B, 1, 0);
RedrawWindow(Handle, nil, 0, RDW_FRAME + RDW_INVALIDATE + RDW_ALLCHILDREN + RDW_NOINTERNALPAINT);
2.图片上显示透明文字
//图片上显示透明的文字
//直接用.Canvas.Brush.Style:=bsClear;
//然后.Canvas.TextOut(x,y,'文字显示透明');
procedure TForm1.Button1Click(Sender: TObject);
var
bitBuf:TBitmap;
begin
bitBuf := TBitmap.Create;
try
bitbuf.LoadfromFile('测试图片.bmp');
Self.Canvas.Draw(0,0,bitbuf);
bitbuf.Transparent := True;
bitbuf.TransparentColor := clWhite; ......
在群里看到有人发了个别人发给他的
我看了写的比较生动 在这转给大家看看
好的 拾取物体函数写好了 下步是如何将代码注入到游戏进程中执行??
1) 小偷开门
PHND:= OpenProcess (PROCESS_ALL_ACCESS, False, PID);得到游戏窗口句柄获得权限
2)小偷在房间搞个放作案方案的地方
TAdd := VirtualAllocEx(PHND, nil, 4096, MEM_COMMIT, PAGE_EXECUTE_READWRITE)
在游戏进程中申请4096字节的空间用来存放函数代码
3)小偷把作案方案放入作案空间
WriteProcessMemory(TPHND, TAdd,PickCall,4096 , WriteCount);
把代码写到游戏进程中 开始的地址是第二步得到的位置
4)小偷在房间中搞个放作案工具的地方
PAdd := VirtualAllocEx(PHND, nil, 128, MEM_COMMIT, PAGE_EXECUTE_READWRITE)
在游戏进程中申请128字节的空间用来存放参数
5)小偷把作案工具放入房间
WriteProcessMemory(TPHND, TAdd,param,128 , WriteCount);
写入参数
6)一起就就绪 开始作案
TmpHandle := CreateRemoteThread(TPHND, nil, 0, TAdd, padd, 0, WriteCount);
WaitForSingleObject(TmpHandle, INFINITE);//等待作案完成
CloseHandle(TmpHandle); //关闭远程的句柄 作案完成后关门闪人
到这里 ......
uses ShellAPI;
procedure TForm1.Button1Click(Sender: TObject);
begin
//用IE打开
ShellExecute(Handle, 'open', 'IExplore.EXE', 'about:blank', nil, SW_SHOWNORMAL);
//用火狐打开
ShellExecute(Handle, 'open', 'firefox.exe', 'about:blank', nil, SW_SHOWNORMAL);
//用默认浏览器打开
ShellExecute(Handle, 'open', 'Explorer.exe', 'about:blank', nil, SW_SHOWNORMAL);
end;
//另一种调用IE打开的方法
uses ComObj;
procedure TForm1.Button1Click(Sender: TObject);
procedure OpenInIE(aURL: string);
var
IE: Variant;
begin
IE := CreateOleObject('InternetExplorer.Application');
IE.Visible := true;
IE.Navigate(aURL);
end;
begin
OpenInIE('www.132435.com');
end;
//第二种方法可以有更多控制
procedure TForm1.Button1Click(Sender: TObject);
procedure OpenInIE(aURL: string); //need uses ComObj;
var
IE: Variant;
begin
......
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//每个汉字的首字母
function GetPyChar(const HZ: AnsiString): string;
const
HZCode: array[0..25, 0..1] of Integer = ((1601, 1636), (1637, 1832), (1833, 2077),
(2078, 2273), (2274, 2301), (2302, 2432), (2433, 2593), (2594, 2786), (9999, 0000),
(2787, 3105), (3106, 3211), (3212, 3471), (3472, 3634), (3635, 3722), (3723, 3729),
(3730, 3857), (3858, 4026), (4027, 4085), (4086, 4389), (4390, 4557), (9999, 0000),
......
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
FMember5 : Integer;
FMember6 : Integer;
FMember7 : WORD;
FMember8 : Integer;
{ Public declarations }
end;
TMyClass = class //创建一个类
Public
FMember1 : Integer;
FMember2 : Integer;
FMember3 : WORD;
FMember4 : Integer;
End;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button ......
Delphi操作XML是很方便的,主要有两种方法;
1.用TClientDataSet操作XML;TClientDataSet是个好东西,用它操作XML是很简单的事,不过缺点是只能操作固定格式的 XML,它适合操作表结构的数据,如果你需要把数据表导出成XML那用TClientDataSet是个好主意,比如下面是一个数据集导出成XML的方 法:
procedure ExportToXML(SrcDataSet:TDataSet;const XMLFileName:String);
var tmpCds:TClientDataSet;
i:integer;
NewField:TFieldDef;
begin
SrcDataSet.DisableControls;
tmpCds:=TClientDataSet.Create(nil);
try
for i:=0 to SrcDataSet.FieldCount-1 do
begin
NewField:=tmpCds.FieldDefs.AddFieldDef;
NewField.Name:=SrcDataSet.Fields[i].FieldName;
NewField.DataType:=SrcDataSet.fields[i].DataType;
NewField.Size:=SrcDataSet.Fields[i].Size;
end;
tmpCds.Cr ......
Delphi操作XML是很方便的,主要有两种方法;
1.用TClientDataSet操作XML;TClientDataSet是个好东西,用它操作XML是很简单的事,不过缺点是只能操作固定格式的 XML,它适合操作表结构的数据,如果你需要把数据表导出成XML那用TClientDataSet是个好主意,比如下面是一个数据集导出成XML的方 法:
procedure ExportToXML(SrcDataSet:TDataSet;const XMLFileName:String);
var tmpCds:TClientDataSet;
i:integer;
NewField:TFieldDef;
begin
SrcDataSet.DisableControls;
tmpCds:=TClientDataSet.Create(nil);
try
for i:=0 to SrcDataSet.FieldCount-1 do
begin
NewField:=tmpCds.FieldDefs.AddFieldDef;
NewField.Name:=SrcDataSet.Fields[i].FieldName;
NewField.DataType:=SrcDataSet.fields[i].DataType;
NewField.Size:=SrcDataSet.Fields[i].Size;
end;
tmpCds.Cr ......