Solved

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

Posted on 2015-02-22
3
289 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
3 Comments
 
LVL 25

Accepted Solution

by:
Sinisa Vuk earned 500 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 Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now