X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/2dd575b95694c126013c912526093ff4915f3398..1066f857936e27fbf24d6b96b5be7703a2c0b0bf:/lmessages.pas diff --git a/lmessages.pas b/lmessages.pas index 1302e29..d6e3745 100755 --- a/lmessages.pas +++ b/lmessages.pas @@ -14,6 +14,11 @@ interface uses pgtypes,sysutils,bsearchtree,strings,syncobjs; + +{$if (fpc_version < 2) or ((fpc_version=2) and ((fpc_release < 2) or ((fpc_release = 2) and (fpc_patch < 2)) ))} + {$error this code is only supported under fpc 2.2.2 and above due to bugs in the eventobject code in older versions} +{$endif} + type lparam=taddrint; wparam=taddrint; @@ -404,11 +409,15 @@ begin //we have to get the window procedure while the structurelock //is still held as the window could be destroyed from another thread //otherwise. - windowproc := window.windowproc; + if window <> nil then begin + windowproc := window.windowproc; + end else begin + windowproc := nil; + end; finally structurelock.release; end; - if window <> nil then begin + if windowproc <> nil then begin result := windowproc(lpmsg.hwnd,lpmsg.message,lpmsg.wparam,lpmsg.lparam); end else begin result := -1;