procedure WMEraseBkGnd(var Msg: TWMEraseBkGnd); message WM_ERASEBKGND;procedure TForm2.WMEraseBkGnd(var Msg: TWMEraseBkGnd);
begin
    Msg.Result := 1 ;
end;

解决方案 »

  1.   

    type
      TSetLayeredWindowAttributes = function (hwnd:HWND; crKey:Longint; bAlpha:byte; dwFlags:longint ):longint; stdcall;var
      Form1: TForm1;
      SetLayeredWindowAttributes: TSetLayeredWindowAttributes = nil;...procedure InitProcs;
    const
      sUser32 = 'User32.dll';
    var
      ModH: HMODULE;
    begin
      ModH := GetModuleHandle(sUser32);
      if ModH <> 0 then
        @SetLayeredWindowAttributes := GetProcAddress(ModH, 'SetLayeredWindowAttributes');
    end;procedure TForm1.FormCreate(Sender: TObject);
    var AStyle:Integer;
    begin
      InitProcs;
      Alpha:=150;//0为完全透明,255完全不透明
      AStyle := GetWindowLong(Handle, GWL_EXSTYLE);
      if (AStyle and $00080000) = 0 then
        SetWindowLong(Handle, GWL_EXSTYLE, AStyle or $00080000);
      if assigned(SetLayeredWindowAttributes) then
        SetLayeredWindowAttributes(Handle,0,Alpha,$2);
    end;
      

  2.   

    老大,你这里编译不过去呀!' Alpha:=150.
    还没有定义变量呢!