Registriert seit: 25. Mai 2006
Ort: Rostock / Bremen
2.037 Beiträge
Delphi 7 Enterprise
|
Re: UpdateLayeredWindow + Buttons/Edit
19. Jan 2009, 15:37
Hey, vllt hilft dir das hier weiter:
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;
Aufruf:
MakeWindowTransparent(form1.handle, 155);
mfg
|
|
Zitat
|