呵呵, 这还不简单? 运行下面的代码就可以了: [
][
][
]
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;
function SetLayeredWindowAttributes(Handle: THandle; crey, bAlpha: Byte; dwFlags: Integer): LongInt; stdcall;
implementation
{$R *.dfm}
const
WS_EX_LAYERED = $80000;
WS_EX_TRANSPARENT = $20;
LWA_ALPHA = $2;
{$EXTERNALSYM SetLayeredWindowAttributes}
function SetLayeredWindowAttributes; external user32 name 'SetLayeredWindowAttributes';
procedure TForm1.FormCreate(Sender: TObject);
var
bTrans: Byte;
OldStyle: Integer;
begin
WindowState := wsMaximized;
BorderStyle := bsNone;
FormStyle := fsStayOnTop;
OldStyle := GetWindowLong(Handle, GWL_EXSTYLE);
SetWindowLong(Handle, GWL_EXSTYLE, OldStyle or WS_EX_LAYERED Or WS_EX_TRANSPARENT);
bTrans := 128;
SetLayeredWindowAttributes(Handle, 0, bTrans, LWA_ALPHA);
end;
end.