|
楼主 |
发表于 2008-5-9 22:58:02
|
显示全部楼层
procedure TForm1.TrackBar1Change(Sender: TObject);. s9 \; H# l0 w% U. \4 [
var
& V/ [& X" r1 g, E. ?+ V h: HWND;4 P5 S) L% H9 F9 E
FormStyle: Integer;* U$ O. h) W0 C5 {3 x# E' ?" e
begin+ H+ U6 z6 b* ]$ ~
h := FindWindow(nil, pchar(Edit1.Text));
7 J9 ?* z% b" t( D5 V) C4 E0 l, j) Q' F if (h<>0) then
. b G7 v/ Y$ b9 m3 j( N. o# G4 i begin
+ s; Y3 R9 L6 y: X* u( u2 H7 F Label3.Caption:='透明度(0-255):'+ IntToStr(trackbar1.position);, U* K- V! c4 ~* e0 \$ K; }: H
FormStyle := GetWindowLong(h, GWL_EXSTYLE);
; p G& F6 o% E, R SetWindowLong(h, GWL_EXSTYLE, FormStyle or WS_EX_LAYERED);" M0 P- |5 d& h4 N, i; A" z
SetLayeredWindowAttributes(h, 0,trackbar1.Position, LWA_ALPHA);( G) O: P7 Z/ Z- V( L8 k/ Y0 t% Y
end
) K3 ?# ]) ?; U# F Z+ F else
4 p' k+ k# o3 D5 k- ^! v% X Label3.Caption:='找不到指定的'+edit1.Text +'窗口!';
: l+ X* ^; m2 r2 U+ E' z P9 Fend;
. V" @) i4 m# _- l( ?/ b- F3 ]procedure TForm1.Button1Click(Sender: TObject);+ y! l# T, O8 h
var" Y1 `0 y8 R6 a1 h' |! r n* c
h: HWND;
5 Z7 T3 R$ x) c! W0 |' @begin- f+ G9 H0 `& I* I8 B
h := FindWindow(nil, pchar(Edit1.Text));
8 v( m( Q5 t* z* E8 n# m if (h<>0) then8 B6 R$ k. {: D* c' Z4 I
if(Edit1.Text<>'HI检测结果')then
$ G. T. f1 j4 S1 Z* D postmessage(h,WM_DESTROY,0,0)+ B! p/ {! @& ~/ C
else
6 p0 u$ N0 R% o, I+ p, M" c& a postmessage(h,wm_keydown,27,65537), e! R5 H# a0 V: a
else
5 F9 B( {1 v+ a' p! l. L: ?: i Label3.Caption:='找不到指定的'+edit1.Text +'窗口!';
+ S; l0 G; U/ q0 W# [end;8 C5 v' [& @: Z
procedure TForm1.FormCreate(Sender: TObject);
; P$ x& Q; ?" wbegin& x) G B) o) C1 I+ j9 X8 X3 B
setwindowpos(form1.Handle,HWND_TOPMOST,form1.Left,form1.Top,form1.Width,form1.Height,0);
' d1 d4 Z% l; E9 A8 cend;
& n8 [8 x) s- [% Z- Mprocedure TForm1.Timer1Timer(Sender: TObject);$ l5 D3 g2 I2 h/ G: ?$ r5 ^. N {
var0 e; f3 u- t# G5 P
arr: array[0..254] of Char;
" V8 ?$ C1 s$ R$ h8 X) x* j h:HWND;2 e ]. q* i, p8 y1 S
begin' K/ S. J8 S$ C% W
h:=getforegroundwindow;
9 E; f( W8 l- A8 U; e GetWindowText(h, @arr, SizeOf(arr));
" x* r7 r1 U/ P2 b9 S l( T if(arr<>'流氓窗口隐藏器')then7 [/ w! c' b1 g* ~* q/ e
Edit1.Text:=arr;
$ `- z8 V# P& t8 b$ R! E; gend;
7 Q9 A; Z6 g* ]% }:loveliness:; A2 Q! F2 J! r
% `% }2 x: I8 _
[ 本帖最后由 hyp 于 2008-5-10 08:16 编辑 ] |
|