Solved

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

Posted on 2015-02-22
3
299 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 26

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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