转自:http://www.delphibbs.com/delphibbs/dispq.asp?lid=603975<br>const<br> WS_EX_LAYERED = $80000;<br> WS_EX_TRANSPARENT = $20;<br> LWA_ALPHA = $2;<br><br>procedure TForm2.Button1Click(Sender: TObject);<br>var<br> OldStyle: Integer;<br>begin<br> OldStyle := GetWindowLong(Handle, GWL_EXSTYLE);<br> SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED);<br> SetLayeredWindowAttributes(Handle, 0, 255, LWA_ALPHA);<br> SetWindowLong(Handle, GWL_EXSTYLE, OldStyle Or WS_EX_LAYERED Or WS_EX_TRANSPARENT);<br>end;<br><br>end.<br>