Capturing USB Plug/Unplug events in Firemonkey
Posted
by
radsdau
on Stack Overflow
See other posts from Stack Overflow
or by radsdau
Published on 2012-11-23T00:59:23Z
Indexed on
2012/11/23
4:59 UTC
Read the original article
Hit count: 332
[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.
© Stack Overflow or respective owner