Delphi - How do I send a windows message to TDataModule?
You can give it a handle easily enough. Take a look at AllocateHWND
in the Classes unit. Call this to create a handle for your data module, and define a simple message handler that will process UM_LOG_ON_OFF.