|
楼主 |
发表于 2008-5-9 22:58:02
|
显示全部楼层
procedure TForm1.TrackBar1Change(Sender: TObject);
# f8 G6 [+ x5 o! _" z' E6 bvar
# M$ `3 }8 N0 z0 [' |' ~ h: HWND;5 m9 E0 V" L- q# H- J8 d
FormStyle: Integer;
3 G: B# w# n; f( e. C' bbegin
! u0 {# b. U+ E; L" h, Y1 q2 T h := FindWindow(nil, pchar(Edit1.Text));, U6 m1 ?5 w4 g2 D
if (h<>0) then6 R+ z" U4 A D
begin
- D. `' G+ p% P" `6 B1 p3 ~; _ Label3.Caption:='透明度(0-255):'+ IntToStr(trackbar1.position);
6 A4 G% J7 N- R. {0 L FormStyle := GetWindowLong(h, GWL_EXSTYLE);
: C, p9 z- D* S/ H) o7 o/ Q# N SetWindowLong(h, GWL_EXSTYLE, FormStyle or WS_EX_LAYERED);/ `% w- C- x& ?, I+ Y6 q3 R
SetLayeredWindowAttributes(h, 0,trackbar1.Position, LWA_ALPHA);
- C" K1 y6 ~9 x% H) Y* ^0 w8 Q end
8 C6 M9 m* ?8 v4 G else
5 M5 \% L2 i9 V0 K. m, i" [ Label3.Caption:='找不到指定的'+edit1.Text +'窗口!';* o8 [" M3 _7 t4 Z
end;. P% z) E9 r- ^1 Z1 S/ _ Y3 z' z' p
procedure TForm1.Button1Click(Sender: TObject);
h) k1 f6 s8 l) b/ Gvar" \* G2 s o3 g1 r9 \
h: HWND;
2 |. O2 q# h/ L7 t' }5 t5 d, bbegin3 s8 p( p# p: F* |4 E3 v U
h := FindWindow(nil, pchar(Edit1.Text));
$ J( T5 m7 D/ k2 t, @3 G2 X if (h<>0) then, \8 Q5 b4 w. i5 o+ {! o
if(Edit1.Text<>'HI检测结果')then
2 ^4 H# a4 C# N$ A. X/ ^7 {3 y postmessage(h,WM_DESTROY,0,0)! b+ C6 j+ Z8 ~0 p3 l( E' ]2 J
else
" t% p( t2 W5 y! p' |8 S- d% b postmessage(h,wm_keydown,27,65537)* V1 P3 ~& k2 ]* g8 V7 }
else
2 j7 o) b" g; {9 z0 K2 D Label3.Caption:='找不到指定的'+edit1.Text +'窗口!';
/ F5 A- s: n" q, i1 dend;8 T. d8 [" f- a& o2 p
procedure TForm1.FormCreate(Sender: TObject);. n2 `; B7 X+ ]( X
begin
6 l! x8 t+ T0 j% ~& esetwindowpos(form1.Handle,HWND_TOPMOST,form1.Left,form1.Top,form1.Width,form1.Height,0);! K8 W" I3 {3 f" p K
end;
. \$ Z; _- ]5 gprocedure TForm1.Timer1Timer(Sender: TObject);
( f% y0 h2 e0 m9 V" evar
+ P) [5 V- N$ t( p3 t arr: array[0..254] of Char;
( X& m% u& H' l4 K h:HWND;# k6 t+ ^: o' R8 _- {4 B0 X
begin+ }* N, K4 e- k5 B$ D
h:=getforegroundwindow;6 l" A9 q' _3 j2 a" u( U) q! }' S
GetWindowText(h, @arr, SizeOf(arr));. @ P6 N+ x" J# I! u8 D, ]- @; x
if(arr<>'流氓窗口隐藏器')then
q' @, q9 g2 @ Edit1.Text:=arr;3 c1 U' T6 H/ T9 F! O9 f: o$ \- c! Z
end;% q9 U: `+ Q. Y$ J( _6 k
:loveliness:
. m1 L& h* x5 Q. I2 r1 @9 ?
0 T. B; F: o/ T. O. Y[ 本帖最后由 hyp 于 2008-5-10 08:16 编辑 ] |
|