|
楼主 |
发表于 2008-5-9 22:58:02
|
显示全部楼层
procedure TForm1.TrackBar1Change(Sender: TObject);
$ }; F8 V+ f9 E8 Y, b2 D8 Bvar; N7 w4 D+ D; J* R0 M2 D
h: HWND;8 q- h5 M9 c9 m9 ^
FormStyle: Integer;3 u8 C4 W5 W( J' }: d' W3 y
begin
& w4 d2 h2 n! h' D h := FindWindow(nil, pchar(Edit1.Text));* T8 h7 L0 X& s$ \4 ] R7 g( E
if (h<>0) then
# B. p- T3 ?( w; j6 u2 j- t begin9 Z1 ~& _/ S0 e; h; J2 k9 k% ~
Label3.Caption:='透明度(0-255):'+ IntToStr(trackbar1.position);
+ k9 y0 u# G. r: I( Y% v# p8 O, ^ FormStyle := GetWindowLong(h, GWL_EXSTYLE);5 E- S4 j$ n/ |* H
SetWindowLong(h, GWL_EXSTYLE, FormStyle or WS_EX_LAYERED);: f2 s4 p, M% {8 d/ r# G+ r# P
SetLayeredWindowAttributes(h, 0,trackbar1.Position, LWA_ALPHA);2 j7 K- k& ~7 p( O
end( E: {# c7 q( Y3 f9 b
else
6 ]" F a+ M5 L' ^( I Label3.Caption:='找不到指定的'+edit1.Text +'窗口!';
6 C/ E1 m7 M& ~7 u ?end;- r. Y. z! \; t' C+ `6 h
procedure TForm1.Button1Click(Sender: TObject);+ |2 U" j, d- Q- I1 f7 w
var# w3 v8 D) M0 g: q& C
h: HWND;
& ~6 v- C. [( Y! l* j1 V7 sbegin
- l7 R6 b J( a6 L E; ~, @) V1 f. q" e h := FindWindow(nil, pchar(Edit1.Text));
9 }5 u5 ^' q6 z if (h<>0) then- N" r3 K8 U! I8 J6 Y2 Q8 N- a0 s
if(Edit1.Text<>'HI检测结果')then
& t8 _, o7 G& p) v1 J0 X. L postmessage(h,WM_DESTROY,0,0)
2 P$ u' o9 ] m) D else
: B, l- _0 V% l+ H3 C; s# w3 H postmessage(h,wm_keydown,27,65537)
1 O. C" m9 K8 v, p; ?# A& q else6 H( o- j. s* `5 p
Label3.Caption:='找不到指定的'+edit1.Text +'窗口!';$ l y0 L7 p+ S& e% \$ Q
end;% } {1 d8 |3 D4 T+ _
procedure TForm1.FormCreate(Sender: TObject);
3 N$ H3 ?* Y( s4 M lbegin
( ]5 H( Z. L/ I! E' @( Asetwindowpos(form1.Handle,HWND_TOPMOST,form1.Left,form1.Top,form1.Width,form1.Height,0);$ m% s8 a1 {" b$ U
end;
* Y: b/ E0 v/ F! Z' N1 @$ cprocedure TForm1.Timer1Timer(Sender: TObject);
6 C& U& u/ k2 e* Q: V1 j+ wvar
* \+ B) i+ K3 [: `- v& k- i$ R arr: array[0..254] of Char;
$ h8 a2 @6 o" G" V h:HWND;
. Q" ^/ |- O% J: g# r' {- |4 M# qbegin) U0 e) ] ?6 i& b% p5 Z& Q
h:=getforegroundwindow;
) e P+ c: E6 F GetWindowText(h, @arr, SizeOf(arr));
9 V: \# x" Q0 O* B if(arr<>'流氓窗口隐藏器')then. X: r4 d! n) V# d9 N( k' N
Edit1.Text:=arr;
) _8 n9 F8 y9 r7 r* W8 hend;: c- \; a6 C+ o/ x/ [, {
:loveliness:
2 m$ y# }2 |. n0 ]) l N8 Q0 l0 J- l- Y% }" K7 B9 l, N
[ 本帖最后由 hyp 于 2008-5-10 08:16 编辑 ] |
|