Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
||
ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
[18.116.90.141] |
|
Сообщ.
#1
,
|
|
|
procedure TForm1.Button1Click(Sender: TObject); var I, X, Y: Integer; TmpReg, WindowRegion: HRGN; hRect: TRect; begin hRect := GetClientRect; X := (Width - hRect.Right) div 2; Y := Height - hRect.Bottom - GetSystemMetrics(SM_CYSIZEFRAME); WindowRegion := CreateRectRgnIndirect(hRect); GetWindowRgn(Handle, WindowRegion); try for I := 0 to ComponentCount - 1 do with TControl(Components[I]) do begin if Parent = Self then begin TmpReg := CreateRectRgn(Left + X, Top + Y, Width + Left + X, Height + Top + Y); try CombineRgn(WindowRegion, TmpReg, WindowRegion, RGN_XOR); finally DeleteObject(TmpReg); end; end; end; TmpReg := CreateRectRgnIndirect(hRect); try GetWindowRgn(Handle, TmpReg); CombineRgn(WindowRegion, TmpReg, WindowRegion, RGN_XOR); SetWindowRgn(Handle, WindowRegion, True); finally DeleteObject(TmpReg); end; finally DeleteObject(WindowRegion); end; end; Автор: Rouse_ |