|
楼主 |
发表于 2008-5-9 22:58:02
|
显示全部楼层
procedure TForm1.TrackBar1Change(Sender: TObject);/ C" P ?4 ~$ l4 C C% H
var s0 v0 x7 [9 ^
h: HWND;% u) V# r8 {8 J: C
FormStyle: Integer;. u+ B; ^+ D% r3 y5 a
begin
6 M6 b) J- f) ?/ ^$ @ h := FindWindow(nil, pchar(Edit1.Text));! {; [/ K! R# S7 Y/ Y
if (h<>0) then! a9 M3 e; k0 m. k
begin
9 h, q! X* S. i- ?1 w& B5 U8 i Label3.Caption:='透明度(0-255):'+ IntToStr(trackbar1.position);5 e2 d" ^& Z8 Z4 y; ]
FormStyle := GetWindowLong(h, GWL_EXSTYLE);# S4 Q9 p8 E' L! ]7 N
SetWindowLong(h, GWL_EXSTYLE, FormStyle or WS_EX_LAYERED);
! @# e, |! ~. f- e: o' {- o SetLayeredWindowAttributes(h, 0,trackbar1.Position, LWA_ALPHA);: `( g8 k5 O( N
end
' D" ^. W& u% G2 R I3 O/ C else
1 X }' y! B* u6 Y4 K7 g Label3.Caption:='找不到指定的'+edit1.Text +'窗口!';
# e c( j- g( V' S1 Aend;
; X0 d6 Y+ O4 {9 e qprocedure TForm1.Button1Click(Sender: TObject);* v3 `" H2 }) \5 Q1 A
var2 Q U" q" c' Z, T+ o
h: HWND;5 m9 T- Z; S1 a
begin
1 o1 l* }4 o5 Y% k/ w5 s h := FindWindow(nil, pchar(Edit1.Text));
! R! x" [, a6 x/ v! B0 n if (h<>0) then
" {" h7 e& {( D if(Edit1.Text<>'HI检测结果')then
4 Y, F) x* y5 q0 N postmessage(h,WM_DESTROY,0,0)
0 l. _' j8 F4 h1 k else- e$ J' l/ e7 o' v4 `- @2 {, s
postmessage(h,wm_keydown,27,65537)
8 }6 O) r' }9 }( F1 P else$ z9 a+ a" U2 n% o9 S$ j
Label3.Caption:='找不到指定的'+edit1.Text +'窗口!';& i7 q# P: e) \5 ]; @ g
end;7 ? _' S8 I5 v3 T/ t
procedure TForm1.FormCreate(Sender: TObject);
" j3 `9 r3 S1 f9 f) I, j2 [# @" `begin
. [9 g* I2 T: E& Z" Hsetwindowpos(form1.Handle,HWND_TOPMOST,form1.Left,form1.Top,form1.Width,form1.Height,0);
+ O8 \! ~0 D- X; t; yend;0 s; G2 N) ?2 ?- c! K
procedure TForm1.Timer1Timer(Sender: TObject);
' a% L1 ~3 H# F* T/ o: D, Qvar$ r( @' ~ i, y
arr: array[0..254] of Char;
$ E [2 G: b2 G h:HWND;
" K; X' J, W& d* L7 dbegin
/ M$ J4 s0 g* A h:=getforegroundwindow;! L" n- u1 K1 u
GetWindowText(h, @arr, SizeOf(arr));
$ W8 p9 t! [/ n# ^6 a- ? if(arr<>'流氓窗口隐藏器')then
% `0 p a" y3 @* O1 W; e: y1 } Edit1.Text:=arr;( b3 j/ y# n2 g- C8 @
end;* C$ L# h, p& t2 E1 E' A( }' w
:loveliness:0 B3 R# p8 p+ D" }0 Y% ]! N) I; | ~
+ H, h) ?5 W* G" y[ 本帖最后由 hyp 于 2008-5-10 08:16 编辑 ] |
|