Как вариант:
program testMouseWheel;
uses
Windows, KOL;
var Form, PB: PControl;
procedure FormMouseWheel(Dummy, Sender: PControl; var Mouse: TMouseEventData);
var zDelta: SmallInt; r:TRect; p: TPoint;
begin
GetWindowRect(PB.Handle, r);
GetCursorPos(p);
if PointInRect(p, r) then
begin
zDelta := HiWord(Mouse.Shift);
if zDelta < 0 then
begin
PB.Width := PB.Width - 10;
PB.Height := PB.Height - 10;
end
else begin
PB.Width := PB.Width + 10;
PB.Height := PB.Height + 10;
end;
end;
end;
procedure PBPaint(Dummy, Sender: PControl; DC: HDC);
begin
Sender.Canvas.FillRect(Sender.ClientRect);
end;
var wp: TWindowPlacement; FullScreened: Boolean;
procedure FullScreen(Undo: Boolean);
begin
if Undo then
begin
Form.Style := Form.Style or (WS_CAPTION or WS_THICKFRAME);
SetWindowPlacement(Form.Handle, @wp);
FullScreened := False;
end
else begin
wp.length := SizeOf(wp);
GetWindowPlacement(Form.Handle, @wp);
Form.Style := Form.Style and not (WS_CAPTION or WS_THICKFRAME);
Form.BoundsRect := MakeRect(0, 0, ScreenWidth, ScreenHeight);
FullScreened := True;
end;
end;
procedure FormKeyUp(Dummy, Sender: PControl; var Key: Longint; Shift: DWORD);
begin
if (Key = VK_F11) and (Shift and (MK_ALT or MK_CONTROL or MK_SHIFT) = 0) then
begin
FullScreen(FullScreened);
end;
end;
begin
Form := NewForm(nil, 'test');
PB := NewPaintBox(Form);
PB.Style := PB.Style or WS_BORDER;
PB.Canvas.Brush.Color := clRed;
PB.OnPaint := TOnPaint(MakeMethod(nil, @PBPaint));
Form.OnMouseWheel := TOnMouse(MakeMethod(nil, @FormMouseWheel));
Form.ExStyle := Form.ExStyle or WS_EX_LAYERED;
Form.OnKeyUp := TOnKey(MakeMethod(nil, @FormKeyUp));
SetLayeredWindowAttributes(Form.GetWindowHandle, clRed, 200, LWA_COLORKEY or LWA_ALPHA);
Run(Form);
end.
Все что относится к развертыванию формы помечено '(***)'.