Recent

Author Topic: Messages ?  (Read 5784 times)

taratata

  • New Member
  • *
  • Posts: 17
Messages ?
« on: January 26, 2009, 08:18:06 am »
I'm trying to install a delphi component I coded a few years ago.
It works well except that I had to remove the code related to the wm_move and wm_moving messages.

These are not recognized by lazarus/fpc.

Are those messages only for the Windows version ?
Is there a way to intercept those messages on the Mac OS ?

Thanks

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Messages ?
« Reply #1 on: January 26, 2009, 03:37:52 pm »
You can use LM_MOVE from the LMessages unit. I'm not familiar with WM_MOVING.

Thanks.

-Phil

taratata

  • New Member
  • *
  • Posts: 17
Re: Messages ?
« Reply #2 on: January 26, 2009, 08:38:59 pm »
Thank you very much.
I was able to intercept the LM_Move message.

Now I have some problems with the LM_NCHITTEST message.

It just doesn't seem to work.

What I want is to intercept the LM_NCHITTEST so the hit is always considered as HTCaption.This way my component can be moved by the user in runtime mode. It works well in Delphi.

I made a quick test with a form
In the procedure section of tform1
procedure NCHITTEST(var msg:tlmessage);message LM_NCHITTEST;

procedure Tform1.NCHITTEST(var msg:tlmessage);
begin
inherited;
caption:='z';
end;

Caption never changes.

Am I missing something ?

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Messages ?
« Reply #3 on: January 26, 2009, 09:13:40 pm »
Although LM_NCHITTEST is defined in LCL, it only appears to be implemented for the win32 widgetset. I really don't know much about it. Maybe you could log a bug report for this and get some feedback.

Although you're not using msg in your handler, its type should probably be TLMNCHITTEST instead of TLMessage.

A couple of the Orpheus controls I ported handle this message - not sure what effect this has since it apparently doesn't work on non-win right now.

Thanks.

-Phil

taratata

  • New Member
  • *
  • Posts: 17
Re: Messages ?
« Reply #4 on: January 26, 2009, 09:20:49 pm »
That's what I figured .

I guess I will have to find another way to let the user move the component at runtime.

If you have a solution let me know :)

Anyway thanks for your help, it's appreciated.

 

TinyPortal © 2005-2018