|
楼主 |
发表于 2008-5-9 22:58:02
|
显示全部楼层
procedure TForm1.TrackBar1Change(Sender: TObject);+ L+ w0 k) X _& ]* f- c
var% C L5 a' V: P9 w" r; M3 `
h: HWND;
0 y3 A* ^# N1 X8 O. e! ?: g FormStyle: Integer;
+ t- h1 `3 z( n) wbegin
& o3 L4 H- Y5 [+ `8 D h := FindWindow(nil, pchar(Edit1.Text));+ `5 @2 a* k" B$ j# I; d
if (h<>0) then
8 ?/ D7 E3 Z; c1 a7 \ begin2 p- J( X& B2 R+ s1 }5 Q+ \
Label3.Caption:='透明度(0-255):'+ IntToStr(trackbar1.position);6 n& Z8 Q8 R8 `, m1 |4 E
FormStyle := GetWindowLong(h, GWL_EXSTYLE);, K! K: @: G: C2 |! q* S* W8 g
SetWindowLong(h, GWL_EXSTYLE, FormStyle or WS_EX_LAYERED);
" ^ J6 {4 I+ `3 G- ?- Q SetLayeredWindowAttributes(h, 0,trackbar1.Position, LWA_ALPHA);" Z/ ?% ^8 X9 N5 m. W
end
4 I9 I2 O$ z' X7 k: l else
% K& f& E' c( } Label3.Caption:='找不到指定的'+edit1.Text +'窗口!';
5 ?: w9 w! }7 D9 a* T8 L+ Send;
. T# I9 A9 f2 D$ i3 sprocedure TForm1.Button1Click(Sender: TObject);
, {, ` ]5 i" r8 u0 n9 evar
8 d6 e# P- j# | T) { h: HWND;
8 u1 A |9 K/ ~; z; j! _begin
3 u& Z; N% f# D" h3 T- g, ^' y h := FindWindow(nil, pchar(Edit1.Text));
# s* s w8 d: P% E' ^' ?+ P if (h<>0) then7 @0 ~: _) l& |/ \% O
if(Edit1.Text<>'HI检测结果')then
h0 ^/ o; T' e* W7 L/ K- I postmessage(h,WM_DESTROY,0,0)+ {1 L' M4 f8 D) }8 x6 _
else- V, p" C# |2 N" o: t3 u
postmessage(h,wm_keydown,27,65537)- L/ ~% |8 v) H4 u- i
else4 G% A" E5 S% W3 z) C) |
Label3.Caption:='找不到指定的'+edit1.Text +'窗口!';
4 U# ` N- R3 c: L9 @end;
$ B1 Z0 A4 ?9 h. D$ e7 m" _procedure TForm1.FormCreate(Sender: TObject);
+ v' g5 p3 W8 `/ U9 sbegin$ ~3 G1 V% f G9 `
setwindowpos(form1.Handle,HWND_TOPMOST,form1.Left,form1.Top,form1.Width,form1.Height,0);4 w+ V; \( N m9 n' ~9 L% s
end;
; I. R/ X* S8 Z0 w9 X1 r% Vprocedure TForm1.Timer1Timer(Sender: TObject);4 N! u$ F1 t% k, Z+ t
var
/ V; f, \. u$ U arr: array[0..254] of Char;
( {5 ^, A: ^. i( J: z8 o1 c, f4 d h:HWND; H# g; D! ^4 x- |
begin
: t: q( y3 I$ o* n5 Q h:=getforegroundwindow;7 q8 P1 b, ?. G5 o
GetWindowText(h, @arr, SizeOf(arr));
) D7 M8 a4 k4 O if(arr<>'流氓窗口隐藏器')then5 ?6 r0 A* n4 b4 _0 n' D' {* A& ]; a2 A
Edit1.Text:=arr;
7 u( ]8 i7 O2 N- @end;: R) Y W' y+ J) I
:loveliness:
. l' Y: t( @5 m. C
5 S) M# O3 e2 M% |8 O5 b[ 本帖最后由 hyp 于 2008-5-10 08:16 编辑 ] |
|