吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 9752|回复: 12
收起左侧

[其他转载] 灰色按钮克星(附delphi源代码)☆-Coded By 芊芊

[复制链接]
Squn 发表于 2010-1-6 13:06
很久很久以前写的了。 翻硬盘翻出来的。

(*^__^*) 嘻嘻

没什么技术含量。

有需要的朋友可以下载下来玩一玩。

也是delphi编写的。


3b525b3f9d73e0f37c1e7197.gif


 
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls,ShellApi;
type
TForm1 = class(TForm)
    Button1: TButton;
    Timer1: TTimer;
    Edit1: TEdit;
    Button2: TButton;
    Edit2: TEdit;
    Label3: TLabel;
    Label4: TLabel;
    Button3: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
private
    { Private declarations }
public
    { Public declarations }
end;
var
Form1: TForm1;
IsEnable:Boolean;
function backfunc(AhWnd:hwnd;AlParam:lParam):boolean;stdcall;
implementation
{$R *.dfm}
function backfunc(AhWnd:hwnd;AlParam:lParam):boolean;stdcall;
var
wndcn:array [0..255] of char;
wndcp:array [0..255] of char;
begin
GetClassName(ahwnd,wndcn,255);
GetWindowText(ahwnd,wndcp,255);
if IsEnable then
    EnableWindow(ahwnd,True) //激活
else
    EnableWindow(ahwnd,False);    //变灰
if (pos('停止&',strpas(wndcp)) > 0) or (pos('激活&',strpas(wndcp)) > 0) then
    EnableWindow(ahwnd,True);
    Result := True;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
    if Button1.Tag = 0 then
    begin
      IsEnable := True;
      Button1.Tag := 1;
      Button1.Caption := '停止&';
      Button2.Tag := 0;
      Button2.Caption := '变灰';
      Timer1.Enabled := True;
    end
    else
    begin
      Button1.Tag := 0;
      button1.Caption := '激活&';
      Timer1.Enabled := False;
    end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
h:thandle;
cp:array [0..255] of char;
begin
h := GetForeGroundWindow();
if h <> 0 then
begin
    edit1.Text := IntToStr(h); //返回句柄显示
    GetWindowText(h,cp,255); // 获取标题
    edit2.Text := Strpas(cp);
    EnumChildWindows(h,@backfunc,0);   //枚举窗口所有控件句柄
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
   if Button2.Tag = 0 then
   begin
     IsEnable := False;
     Button2.Tag := 1;
     Button2.Caption := '停止&';
     Button1.Caption := '激活&';
     Button1.Tag := 0;
     Timer1.Enabled := True;
   end else
   begin
     Button2.Tag := 0;
     Button2.Caption := '变灰';
     Timer1.Enabled := False;
     Button1.Enabled := True;
   end;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
   Timer1Timer(form1);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
ShowMessage('    灰色按钮激活小工具☆    '+#13#10+#13#10
+'    Coder : Squn    '+#13#10+#13#10+ 'Http://hi.baidu.com/Squnicg')
//ShellExecute(Application.Handle, nil, 'http://hi.baidu.com/squnicg', nil, nil, SW_SHOWNORMAL);
end;
end.

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

ok518 发表于 2010-1-7 11:51
很好,学习一下,谢谢分享LZ
dry 发表于 2010-1-6 20:57
datochan 发表于 2010-1-7 21:50
本帖最后由 bester 于 2010-1-7 21:52 编辑

嘿嘿,喜欢D的程序,感觉用D的人都很强大~

过来支持一下你,希望继续努力,嘿嘿。

妹子,你是最棒的[s:350]
yly 发表于 2010-1-8 21:19
用过类似程序,收藏个源码
182433123 发表于 2010-1-8 21:24
支持 O(∩_∩)O~
 楼主| Squn 发表于 2010-1-25 15:39
回复 4# bester


    嘻嘻 謝謝破船大哥的支持~~
逍遥·神剑 发表于 2010-2-15 16:21
特来支持芊芊mm
longzhiren 发表于 2010-3-15 18:29
试试看看 好用不
nevsayno 发表于 2010-3-24 04:25
句柄貌似。。。

支持芊芊MM[s:55]
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-9-21 19:43

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表