Recent

Author Topic: Lazarus and TMessageEvent from delphi?  (Read 9515 times)

snorkel

  • Hero Member
  • *****
  • Posts: 817
Lazarus and TMessageEvent from delphi?
« on: February 05, 2016, 10:41:00 pm »
Hi,
I am trying to get Overbyte ICS to compile (old version 5) anyways it is raising a error on TMessageEvent:

EmulVT.pas(301,24) Error: Identifier not found "TMessageEvent"

which is:

   FAppOnMessage    : TMessageEvent; 

Is there a FPC/Laz equivalent?

I tried to google "Lazarus and tmessagevent" but got nothing back.

 



***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Lazarus and TMessageEvent from delphi?
« Reply #1 on: February 06, 2016, 12:32:39 am »
TMessageEvent is a windows specific event type of TApplication.Onmessage.

To my best knowledge Lazarus does not implement that event.

The type however is easy to define:

Code: Pascal  [Select][+][-]
  1.   TMessageEvent = procedure (var Msg: TMsg; var Handled: Boolean) of object;

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Lazarus and TMessageEvent from delphi?
« Reply #2 on: February 06, 2016, 12:44:30 am »
Thanks :-)
I did stick that in the unit and I got past that part of the compile.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Lazarus and TMessageEvent from delphi?
« Reply #3 on: February 06, 2016, 05:15:12 pm »
Getting a not found error on flags i.e.
{$IFDEF COMPILER6_UP}
        Flags     := (Flags and not tfCRLF) or (tfCRLF * Byte(Style));
{$ENDIF}   

I don't have a copy of Delphi to look it up, and google was not helpful searching for flags.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Lazarus and TMessageEvent from delphi?
« Reply #4 on: February 06, 2016, 06:03:28 pm »

I usually use the online available delphi information like http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/System_TTextRec.html

By googling it seems that tfcrlf is a bit flag for the (text?) file descriptors "flags" field.

That field is used by FPC to pass the following info:

sysfile.inc:  when (flags and $100)   the file will be append
sysfile.inc:  when (flags and $1000)  the file will be truncate/rewritten
sysfile.inc:  when (flags and $10000) there is no check for close (needed for te

to do_open. (the system dependent file open function), but I can't find any other use.

so probably whatever it is, it is not implemented in a compatible way. Does it manipulate ttextrec(f).flags?

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Lazarus and TMessageEvent from delphi?
« Reply #5 on: February 10, 2016, 07:04:09 am »
just in case anyone is interested.
The version 5 of ICS compiles with Lazarus 1.6rc2 if you create everything in code.  However the newer ones required too much fooling around to get working.
So anyway what I wanted to do was get my Delphi app that uses the ICS ftpserver ported over to lazarus but I discovered the FTP server component in indy 10 works perfectly in Laz 1.6 and FPC 3.0 and the SSL is fully functioning as well, so I am using that to port the app now.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

HermanR

  • New member
  • *
  • Posts: 9
Re: Lazarus and TMessageEvent from delphi?
« Reply #6 on: April 20, 2016, 09:32:30 am »
Hello,
I want to make some sort of screenlock with special info on it. Therefore I need a click/button timeout.
To reset the timer I wanted to use the OnMessage event and filter the WM_MouseDown and WM_KeyPress events.
Can anyone advice on how to do this?
I use Lazarus 1.4.0 / fpc 2.6.4 on Win7/64bit. Target app WinCE 5
Thanks in advance

HermanR

  • New member
  • *
  • Posts: 9
Re: Lazarus and TMessageEvent from delphi?
« Reply #7 on: April 20, 2016, 10:12:15 am »
I found my solution in another post
Topic: Is there a function that allows form to capture events on child controls?  (Read 1441 times)
Sorry I didn't find it first

 

TinyPortal © 2005-2018