Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#4

Re: Anderes fenster transparent machen!

  Alt 4. Sep 2006, 16:19
Na gut

Dann hab ich hier was aus meiner privaten Code-Lib

Delphi-Quellcode:
procedure MakeWindowTransparent(Wnd: HWND; Alpha: Byte);
const
  WS_EX_LAYERED = $80000;
  LWA_ALPHA = $02;
type
  TSetLayeredWindowAttributes = function(const hWnd: HWND; crKey: Integer; bAlpha: Byte; dwFlags: Integer) : Integer; stdcall;
var
  SetLayeredWindowAttributes : TSetLayeredWindowAttributes;
  User32DLL : THandle;
begin
  User32DLL := LoadLibrary('User32.dll');
  if User32DLL <> 0 then
  begin
    @SetLayeredWindowAttributes := GetProcAddress(User32DLL, 'SetLayeredWindowAttributes');
    if @SetLayeredWindowAttributes <> nil then
    begin
      SetWindowLong(Wnd, GWL_EXSTYLE, GetWindowLong(Wnd, GWL_EXSTYLE) or WS_EX_LAYERED);
      SetLayeredWindowAttributes(Wnd, 0, Alpha, LWA_ALPHA);
    end;
  end;
  FreeLibrary(User32DLL);
end;
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat