Recent

Author Topic: [How to?] Call "EventOnMessage" inside "onClickEvent"  (Read 3552 times)

codeman

  • Jr. Member
  • **
  • Posts: 78
[How to?] Call "EventOnMessage" inside "onClickEvent"
« on: December 01, 2021, 04:13:31 am »
Hello, how to call eventOnMessage inside onClick Event??


Code: Pascal  [Select][+][-]
  1. procedure TForm1.EventOnMessage(var Msg: tagMSG; var Handled: Boolean);
  2. var
  3.   NrFiles, i : Integer;
  4.   Buffer : Array[0..255] of Char;
  5. begin
  6. try
  7.    Handled:=Msg.Message=WM_DROPFILES;
  8.    if not Handled then
  9.      exit;
  10.  
  11.   attachedSelected:=true;
  12.   NrFiles:=DragQueryFile(Msg.Wparam,$FFFFFFFF,Buffer,256);
  13.  
  14. .....
  15. .....
  16.  
  17. finally
  18.     DragFinish(Msg.WParam);
  19. end;
  20.  


Code: Pascal  [Select][+][-]
  1. procedure TForm1.button1Click(Sender: TObject);
  2. begin
  3.        ???? EventOnMessage( ?? );  
  4.    
  5.  Everything i tried, I get that compiling error (Types of actual and formal var parameters must be identical)
  6. end;
  7.  


Thanks for considering my request!
« Last Edit: December 01, 2021, 06:21:30 pm by codeman »
Lazarus v2.02 Win10

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 762
Re: [How to?] Call "EventOnMessage" inside "onClickEvent"
« Reply #1 on: December 01, 2021, 04:45:18 am »
Have you tried to do it standard way?
Code: Pascal  [Select][+][-]
  1. procedure WMDropFiles(var Message : TMessage); message WM_DROPFILES;
  2.  
I haven't checked, but may be there is existing handler for this message?
29.12.2021 - migration to DynamicData 4.1 is completed - complete overhaul of data access driver.
My project still requires full Delphi 2009 support to be ported to Lazarus.
It's time to finally do it, because Delphi 2009 is 13 years old.

codeman

  • Jr. Member
  • **
  • Posts: 78
Re: [How to?] Call "EventOnMessage" inside "onClickEvent"
« Reply #2 on: December 01, 2021, 06:21:53 pm »
Thank you both! Solved! :)
Lazarus v2.02 Win10

 

TinyPortal © 2005-2018