Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Hook into main loop in Firemonkey somehow to process data from another thread.

Posted on 2015-02-22
3
Medium Priority
?
372 Views
Last Modified: 2015-05-30
I wonder if there is a way to hook onto an applications main loop in Firemonkey to be able to process a custom made queue from a different thread. In other words, in the Win32 world I would be able to create a hook to the message handling routine, and check for my own custom windows messages and do something. In Firemonkey and crossplatform this isn't possible and I wonder how to do something equal.

I am currently thinking about working through the data from my other threads queue in an TIdleMessage event.
  FIdleHandlerID := TMessageManager.DefaultManager.SubscribeToMessage(TIdleMessage,EventMessageListener);
But I dont know if thats a good way.

How does other developers write code that needs to regulary check results from another thread without having to manually add calls in the main threads code that checks the queue in Delphi Firemonkey?
0
Comment
Question by:Probie
1 Comment
 
LVL 28

Accepted Solution

by:
Sinisa Vuk earned 2000 total points
ID: 40631994
I would use thread with custom procedure.  As an event - start thread with synced procedure where you do some stuff. (similar to: synchronize-and-queue-with-parameters/)
Another solution is very well described here:
http://francois-piette.blogspot.dk/2013/12/firemonkey-android-windows-and.html
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question