//以前用XP,使用按键精灵还是不错的,但至从换成64位的win7平台后,按键精灵9在不开启神盾的情况下无法启动脚本。
//为了能在64位的win7下继续使用类似按键精灵的功能,现改用delphi来制作,最大的好处是灵活,而且不收费
![]()
//以下内容为网络上摘抄,暂时还未验证,如有同类爱好的朋友可以共同探讨
unit kbKernel;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
pRGBTripleArray = ^TRGBTripleArray;
TRGBTripleArray = ARRAY[0..32767] OF TRGBTriple;
TRGBTriple =
PACKED RECORD
rgbtBlue : BYTE;
rgbtGreen: BYTE;
rgbtRed : BYTE;
END;
procedure CloseWindows;
procedure LeftClick(x, y: integer);
procedure RightClick(x, y: integer);
procedure DoubleClick(x, y: integer);
procedure MoveTo(x, y: integer);
procedure Presskey(vk: integer);
procedure PressTwoKey(key1, key2: integer);
function GetPixelColor(x, y: integer): integer;
function Findcolor(iLeft, iTop, iRight, iBottom, Acolor: integer;
var iX, iY: integer):boolean;
function Findpicture(iLeft, iTop, iRight, iBottom: integer;
strPic: string; var iX, iY: integer):boolean;
procedure inputNum(num:integer);
function GetXY(var x, y: integer): boolean;
implementation
procedure CloseWindows();
var
hdlProcessHandle : Cardinal;
hdlTokenHandle : Cardinal;
tmpLuid : Int64;
//tkpPrivilegeCount : Int64;
tkp : TOKEN_PRIVILEGES;
tkpNewButIgnored : TOKEN_PRIVILEGES;
lBufferNeeded : Cardinal;
Privilege : array[0..0] of _LUID_AND_ATTRIBUTES;
begin
hdlProcessHandle := GetCurrentProcess;
OpenProcessToken(hdlProcessHandle,
(TOKEN_ADJUST_PRIVILEGES Or TOKEN_QUERY),
hdlTokenHandle);
// Get the LUID for shutdown privilege.
LookupPrivilegeValue('', 'SeShutdownPrivilege', tmpLuid);
Privilege[0].Luid := tmpLuid;
Privilege[0].Attributes := SE_PRIVILEGE_ENABLED;
tkp.PrivilegeCount := 1; // One privilege to set
tkp.Privileges[0] := Privilege[0];
// Enable the shutdown privilege in the access token of this
// process.
AdjustTokenPrivileges(hdlTokenHandle,
False,
tkp,

最低0.47元/天 解锁文章
292

被折叠的 条评论
为什么被折叠?



