1,183
社区成员
发帖
与我相关
我的任务
分享
SetWindowLong(self.Handle,GWL_EXSTYLE,
GetWindowLong(Self.Handle,GWL_EXSTYLE) xor $80000);
SetLayeredWindowAttributes(Self.Handle,0,100,LWA_ALPHA);
,透明效果出来了。可是我想把它嵌入桌面,但一加上ParentWindow:=FindWindow('Progman',Nil);
透明效果就没了,是怎么回事呢?procedure TForm1.Edit1DblClick(Sender: TObject);
begin
Windows.SetParent(Handle, FindWindow('Progman',Nil));
end;
可是双击edit1控件后窗口就消失了。。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
const
{An array of points for the star region}
RgnPoints:array[1..10] of TPoint=
((x:203;y:22),(x:157;y:168),(x:3;y:168),(x:128;y:257),
(x:81;y:402),(x:203;y:334),(x:325;y:422),(x:278;y:257),
(x:402;y:168),(x:249;y:168));//确定顶点
LinePoints:array[1..11] of Tpoint=
((x:199;y:0),(x:154;y:146),(x:2;y:146),(x:127;y:235),
(x:79;y:377),(x:198;y:308),(x:320;Y:396),(x:272;y:234),
(x:396;y:146),(x:244;y:146),(x:199;Y:0));
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var Rgn:HRGN;
begin
Setwindowpos(Form1.Handle,HWND_TOPMOST,Form1.Left,form1.Top,Form1.Width,Form1.Height,0);
Rgn:=CreatepolygonRgn(Rgnpoints,High(RgnPoints),ALTERNATE);
SetWindowRgn(Handle,rgn,True);
Form1.color:=clgreen;
end;
end.