Forum > LCL
[How to?] Call "EventOnMessage" inside "onClickEvent"
(1/1)
codeman:
Hello, how to call eventOnMessage inside onClick Event??
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.EventOnMessage(var Msg: tagMSG; var Handled: Boolean);var NrFiles, i : Integer; Buffer : Array[0..255] of Char;begintry Handled:=Msg.Message=WM_DROPFILES; if not Handled then exit; attachedSelected:=true; NrFiles:=DragQueryFile(Msg.Wparam,$FFFFFFFF,Buffer,256); .......... finally DragFinish(Msg.WParam);end;
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.button1Click(Sender: TObject);begin ???? EventOnMessage( ?? ); Everything i tried, I get that compiling error (Types of actual and formal var parameters must be identical)end;
Thanks for considering my request!
Mr.Madguy:
Have you tried to do it standard way?
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure WMDropFiles(var Message : TMessage); message WM_DROPFILES; I haven't checked, but may be there is existing handler for this message?
codeman:
Thank you both! Solved! :)
Navigation
[0] Message Index