灰色按钮克星(附delphi源代码)☆-Coded By 芊芊
很久很久以前写的了。 翻硬盘翻出来的。
(*^__^*) 嘻嘻
没什么技术含量。
有需要的朋友可以下载下来玩一玩。
也是delphi编写的。
下载链接:http://www.brsbox.com/filebox/down/fc/66c5d4cf8083d5f9373d0be662809af8
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 of char;
wndcp:array 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 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.
很好,学习一下,谢谢分享LZ 不错。。学习了。。楼主谢谢分享 本帖最后由 bester 于 2010-1-7 21:52 编辑
嘿嘿,喜欢D的程序,感觉用D的人都很强大~:loveliness:
过来支持一下你,希望继续努力,嘿嘿。
妹子,你是最棒的 用过类似程序,收藏个源码 支持 O(∩_∩)O~ 回复 4# bester
嘻嘻 謝謝破船大哥的支持~~ 特来支持芊芊mm 试试看看 好用不 句柄貌似。。。:(eew
支持芊芊MM
页:
[1]
2