Recent

Author Topic: [SOLVED] Code clean up at function LCLSendActivateMsg  (Read 1629 times)

lagprogramming

  • Sr. Member
  • ****
  • Posts: 406
[SOLVED] Code clean up at function LCLSendActivateMsg
« on: May 22, 2023, 10:54:52 am »
lcl/lclmessageglue.pas has function LCLSendActivateMsg(const Target: TControl; Active: Word; Minimized: Boolean; ActiveWindow: HWND = 0): PtrInt;
Code: Pascal  [Select][+][-]
  1. function LCLSendActivateMsg(const Target: TControl; Active: Word; Minimized: Boolean; ActiveWindow: HWND = 0): PtrInt;
  2. var
  3.   Mess: TLMActivate;
  4. begin
  5.   Result := 0;
  6.   FillChar(Mess, SizeOf(Mess), 0);
  7.   Mess.Msg := LM_ACTIVATE;
  8.   Mess.Active := Active;
  9.   Mess.Minimized := Minimized;
  10.   Mess.ActiveWindow := ActiveWindow;
  11.   Result := DeliverMessage(Target, Mess);
  12. end;

The following patch removes the useless initial "Result := 0;" line.
Code: Pascal  [Select][+][-]
  1. diff --git a/lcl/lclmessageglue.pas b/lcl/lclmessageglue.pas
  2. index d898741e6e..efabad983f 100644
  3. --- a/lcl/lclmessageglue.pas
  4. +++ b/lcl/lclmessageglue.pas
  5. @@ -163,7 +163,6 @@ function LCLSendActivateMsg(const Target: TControl; Active: Word; Minimized: Boo
  6.  var
  7.    Mess: TLMActivate;
  8.  begin
  9. -  Result := 0;
  10.    FillChar(Mess, SizeOf(Mess), 0);
  11.    Mess.Msg := LM_ACTIVATE;
  12.    Mess.Active := Active;
« Last Edit: May 25, 2023, 11:03:49 am by lagprogramming »

Bart

  • Hero Member
  • *****
  • Posts: 5306
    • Bart en Mariska's Webstek
Re: Code clean up at function LCLSendActivateMsg
« Reply #1 on: May 22, 2023, 10:21:38 pm »
Committed.
Thanks for reporting.

Bart

 

TinyPortal © 2005-2018