D
D
David Manzhula2015-11-25 23:41:15
Delphi
David Manzhula, 2015-11-25 23:41:15

How to make a phantom window in Delphi?

How to make a window in Delphi, but so that the cursor (i.e. click) passes "through it", as, for example, in the volume indicator on laptops?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mercury13, 2015-11-26
@da411d

1. Turn on the AlphaBlend property. Even if you want an opaque window, turn it on anyway.
2. Redefine two functions.

procedure TfmMain.CreateParams(var Param : TCreateParams);  // override
begin
  inherited;
  Param.ExStyle := Param.ExStyle or WS_EX_TRANSPARENT;
end;

procedure TfmMain.WmNcHitTest(var Msg : TWMNCHitTest); // message WM_NCHITTEST;
begin
  Msg.Result := HTTRANSPARENT;
end;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question