Capturing USB Plug/Unplug events in Firemonkey
- by radsdau
[RAD Studio XE3 / C++]
I have a FMX project running in Windows only at this stage, but I need to detect events when USB devices are connected and disconnected. I have a similar VCL app that can do this fine, but the Application-HookMainWindow is not exposed in FMX (only VCL).
Is there an elegant way to handle this? Or do I have to hack some VCL stuff into my FMX app to make that work? I'd imagine I have to abstract it so I can support other platforms down the track. For the meantime though I need to get the Windows solution working.
If the 'VCL hack' thing is required, how would I reference the vcl::Forms::Application from within my Fmx app?
Cheers.