Посмотри, как это в VCL сделано:
| Код | Type TSetLayeredWindowAttributes = Function (Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; Stdcall;
Var 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;
|
А здесь идет присвоение AlphaBlend:
| Код | Procedure TCustomForm.SetLayeredAttribs; Const cUseAlpha: array [Boolean] of Integer = (0, LWA_ALPHA); cUseColorKey: array [Boolean] of Integer = (0, LWA_COLORKEY); Var AStyle: Integer; Begin If Not (csDesigning in ComponentState) And (Assigned(SetLayeredWindowAttributes)) And HandleAllocated Then Begin ... End; End;
|
Если система не поддерживает AlphaBlend, то просто ничего не произойдет. |