I recently switched from Lazarus 32 Bit to Lazarus 64 Bit (FPC 3.2.2). There are some very substantial enhancements and improvements. Thank you to everyone who has been working on Lazarus to bring Lazarus to its current state.
I have been using the following code for many years within Lazarus 32 Bit.
When I recently switched to 64 Bit, the only line of code that has a hiccup is the assignment of PrevWndProc statement.
Everything else compiles.
From the Lazarus Installation (C:\Lazarus\LCL), GWL_WNDPROC is defined in LCLType.pp as:
GWL_WNDPROC = -4;
From the Lazarus Installation, WNDPROC is defined in C:\Lazarus\fpc\3.2.2\source\rtl\win\wininc\base.inc as:
WNDPROC = function (_para1:HWND; _para2:UINT; _para3:WPARAM; _para4:LPARAM):LRESULT;stdcall;
In the unit variable section of my project, PrevWndProc is defined:
var
PrevWndProc: WNDPROC;
Additionally, WndCallBack is defined as:
function WndCallback(Ahwnd: HWND; uMsg: UINT; wParam: WParam; lParam: LParam):LRESULT; stdcall;
The following line of code used to compile fine in 32 Bit:
PrevWndProc := Windows.WNDPROC(SetWindowLong(Self.Handle,GWL_WNDPROC,PtrInt(@WndCallback)));
But now it has a problem in 64 Bit (FPC 3.2.2) with this error:
Illegal Type Conversion: "LongInt" to <procedure variable type of function(QWord;LongWord;Int64;Int64):Int64;StdCall;
Can someone help me with a solution, please?
Thank you.