Recent

Author Topic: [SOLVED] Declarations clean up inside win32callback.inc  (Read 2679 times)

lagprogramming

  • Sr. Member
  • ****
  • Posts: 406
[SOLVED] Declarations clean up inside win32callback.inc
« on: August 07, 2023, 11:23:39 am »
According to the docs/INSTALL.txt file, Lazarus requires FPC (Free Pascal) version 3.2.0 (or newer). FPC 3.2.0 has been released in 2020-06-16.
lcl/interfaces/win32/win32callback.inc has the following lines:
1/2
Code: Pascal  [Select][+][-]
  1. {$IF NOT DECLARED(WM_DPICHANGED)} // WM_DPICHANGED was added in FPC 3.1.1
  2. const
  3.   WM_DPICHANGED = $02E0;
  4. {$ENDIF}
WM_DPICHANGED has been added to rtl/win/wininc/messages.inc at Dec 01, 2016 by commit aef26e86: * Fix bug #31040
2/2
Code: Pascal  [Select][+][-]
  1. // FlashWindowEx is not (yet) in FPC
  2. type
  3.   FLASHWINFO = record
  4.     cbSize: UINT;
  5.     hwnd: HWND;
  6.     dwFlags: DWORD;
  7.     uCount: UINT;
  8.     dwTimeout: DWORD;
  9.   end;
  10.   PFLASHWINFO = ^FLASHWINFO;
  11.  
  12. function FlashWindowEx(pfwi:PFLASHWINFO):WINBOOL; stdcall; external 'user32' name 'FlashWindowEx';
On Feb 09, 2019, FlashWindowEx has been added to rtl/win/wininc/struct.inc and rtl/win/wininc/func.inc by commit 3a6d0d9d: * flashwindowex, mantis #35048, patch by 440bx

The following patch removes the declarations from LCL. I had no problems crosscompiling from Linux to Windows. I don't have Windows, so this time you have to test it, too. Rebuilding Lazarus clean in Windows might be enough.
Code: Pascal  [Select][+][-]
  1. diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc
  2. index f582cfba22..85f2873057 100644
  3. --- a/lcl/interfaces/win32/win32callback.inc
  4. +++ b/lcl/interfaces/win32/win32callback.inc
  5. @@ -890,19 +890,6 @@ begin
  6.    end;
  7.  end;
  8.  
  9. -// FlashWindowEx is not (yet) in FPC
  10. -type
  11. -  FLASHWINFO = record
  12. -    cbSize: UINT;
  13. -    hwnd: HWND;
  14. -    dwFlags: DWORD;
  15. -    uCount: UINT;
  16. -    dwTimeout: DWORD;
  17. -  end;
  18. -  PFLASHWINFO = ^FLASHWINFO;
  19. -
  20. -function FlashWindowEx(pfwi:PFLASHWINFO):WINBOOL; stdcall; external 'user32' name 'FlashWindowEx';
  21. -
  22.  procedure TWindowProcHelper.HandleSetCursor;
  23.  var
  24.    lControl: TControl;
  25. @@ -2023,10 +2010,6 @@ var
  26.    ACtl: TWinControl;
  27.    LMouseEvent: TTRACKMOUSEEVENT;
  28.    MaximizedActiveChild: WINBOOL;
  29. -{$IF NOT DECLARED(WM_DPICHANGED)} // WM_DPICHANGED was added in FPC 3.1.1
  30. -const
  31. -  WM_DPICHANGED = $02E0;
  32. -{$ENDIF}
  33.  begin
  34.    try
  35.    LMessage := Default(TLMessage);
« Last Edit: August 08, 2023, 11:45:48 am by lagprogramming »

Bart

  • Hero Member
  • *****
  • Posts: 5349
    • Bart en Mariska's Webstek
Re: Declarations clean up inside win32callback.inc
« Reply #1 on: August 07, 2023, 11:35:41 am »
Is FLASHWINFO  present in fpc 3.2.0 as well?

Bart



 

TinyPortal © 2005-2018