WMSysCommand メッセージを使用して、キャプション バー ボタン (最大化/最小化) の動作と WMNCHitTest を使用するために必要な最近の更新を変更していますが、コードが長いため、これら 2 つの関連メッセージを複数の手順で分割したくありません。
他のメッセージからプライベート宣言 (メッセージ) にアクセスできますか? もし私ができるなら - どうやってそれをするのですか?
procedure TForm1.WMNCHitTest(var Msg: TWMNCHitTest) ;
begin
SendMessage(Handle, HTCAPTION, WM_NCHitTest, 0); // or other wParam or lParam ????
end;
procedure TForm1.WMSysCommand;
begin
if (Msg.CmdType = SC_MAXIMIZE or 61488) or (Msg.Result = htCaption or 2) then // if command is Maximize or reciever message of Caption Bar click
begin
if CheckWin32Version(6, 0) then
Constraints.MaxHeight := 507
else
Constraints.MaxHeight := 499;
Constraints.MaxWidth := 0;
end
else if (Msg.CmdType = SC_MINIMIZE or 61472) or (Msg.Result = htCaption or 2) then // if command is Minimize
begin
if (EnsureRange(Width, 252, 510) >= (510 / 2)) then
PreviewOpn.Caption := '<'
else
PreviewOpn.Caption := '>';
end;
DefaultHandler(Msg); // reset Message handler to default ( Application )
end;
スー...私は正しく考えており、正しいコマンドをまったく知らないのか、それとも完全に強気な考えを持っているのでしょうか?
よろしく。助けてくれてありがとう...