FPiette 383 Posted March 8, 2022 I have the need to use custom messages in a FMUX (Firemonkey Linux) application. Something similar to Windows PostMessage / SendMessage / AllocateHWnd / DeallocateHWnd / WndProc / Message handlers and all that stuff. Any idea? Share this post Link to post
FPiette 383 Posted March 8, 2022 Quote Queues? Yes and no... The OS already has a queue somewhere and FMUX is using it. The real problem is installing the custom message handler and posting message in that queue. FMUX already has HandleMessage and ProcessMessage but I have not found anything to post my own message and install a handler for it. Share this post Link to post
FPiette 383 Posted March 8, 2022 I've found how to do it, more or less. This invokes TMessageManager class. There is only a SendMessage, no PostMessage. And there is no thread switch like in Windows messaging system. When you call SendMessage from a thread, the message subscriber (That is the message handler in Windows speaking) is directly called, that is it runs in the context of the sending thread. Actually there is neither a message queue which is logical since there is no PostMessage to queue a message. I can probably build the missing parts above the existing... Share this post Link to post