This answer explains how to use WMI to find attached USB mass storage devices by drive letter but I am trying to find the names of (or UNC paths to) attached MTP or PTP devices, such as attached cameras or mobile devices which are mounted without a drive letter, so that I can crawl their directories to search for images. How can I do this?
How to enumerate MTP and PTP devices
1.5k Views Asked by Ilkka At
1
There are 1 best solutions below
Related Questions in DELPHI
- How can I read the header of request to webserver
- Receiving Notifications for Individual Task Completion OmniThreadLibrary Parallel.ForEach
- Delphi - How to get result of function from QuickReport without viewing a report?
- Out of memory while adding documents to a Firebird BLOB field with Delphi
- How to MakeScreenshot fullpage on Delphi
- How to program a COM object with an IEnumerator, IEnumerable interface inside
- How to Dynamically Add Controls to Delphi Form
- How to write a string in Stringrid with DelimitedText in FMX Delphi 11
- TGrid/TStringGrid multi cell selection / multi editing in delphi firemonkey (12)
- How to localize "Today" in the Delphi TMonthCalendar?
- How can I call a SOAP webserver method in Vue.js?
- Efficiently Handling Large Number of API Calls with Delphi 10.4 and OmniThreadLibrary
- Delphi can not compile the unit create by its "XML Data Binding Wizard"
- Save Form Properties in File and then restore those Properties after reopening
- Is it possible to open a blob without saving it to file
Related Questions in DELPHI-XE7
- show information with Rolling / moving messages delphi xe7
- Nested forms with Showmodal in Win32/OSX
- Can I compare Real48 using generics.defaults?
- 'Session Ended' when lauching app from Delphi to iOS Simulator
- OnClick Event for TListbox, Calls while using the arrow Keys to change a selected item
- Why does my application using OmniThreadLibrary Parallel.Pipeline continue remain running in the background after being closed?
- Delphi XE7 TFDTable View RowID error
- HasValidFileNameChars fails for UNC files
- What would the design look like for a class that implements a threaded email sending queue?
- Understanding the use of views in a Multi-Device Project
- Change sender when sending email with TIdSmtp
- Is there any interference between borlndmm.dll Access Violation and UAC/run as Administrator?
- How do I make a beep sound in Android using Delphi and the API?
- Using TChart in C++Builder XE7
- What does Opt.out mean?
Related Questions in MTP
- How to get MTP device Available Storage & Storage Capacity using C#?
- can i read MTP/PTP media with USB OTG on Android?
- Connected a Mobile device (Android) as MTP, Now can we access this device and get Time
- Remove Portable Devices File Using Java
- How to manage files on an MTP Portable Device?
- Cannot Resolve PortableDeviceToHostImpl32 in jmtp library
- Flush MTP connection with Android tablet?
- WPD Service api implimentation (Status Service) to get free space on WPD device
- information on accesing MTP devices in a Windows form application in C#
- How to make Android MTP file transfer work again
- Mounting device as mass storage instead of mtp
- How to detect MTP slave mode on Android
- How to import multiple files from a smartphone in a WPF app?
- How to make a dynamic structure in C
- Connect Android phone via mtp
Related Questions in WPD
- Windows 10 can't replace a deleted file on some Android devices' data directory
- Is there a way to set an exact match between a connected device via adb and via mtp?
- Where can I get PortableDevice.h or WPD defined constant GUIDs and such?
- Windows Portable Devices (WPD), C#: How to set "date modified" when creating a file on Portable Device
- PortableDeviceApiLib show progress TransferContentToDevice()
- WPD/MTP PortableDevices, Content is always empty (Windows, VisualStudio 2012, VB.NET)
- Disable portable device in windows
- PortableDeviceManagerClass in C# not able to initialize
- How to get parameters of an Picture Transfer Protocol event in Windows Portable Devices?
- How to create folder in MTP device by c# windows application?
- wpd c# enumerating devices content when more then one device is present
- How to close Windows Portable Device IStream opened in Python / pythoncom / comtypes
- How to get filtered target device information from windows upper class filter
- IPortableDeviceEventCallback doesn't work properly (strange behaviour)
- How to get notifications for File Changes on CD / DVD drive?
Related Questions in PTP
- zynqmp ptp clock adjustment
- requestTakePicture() doesn't do anything
- Zero conf time synchronization in a LAN
- Disable frequency synchronization while using ptp4l
- Run Linux PTP on crontab at boot
- Configuring IEEE 1588 PTPV2 with STM32 and ksz8463
- Apple PTP - withCompleteContentCatalog not firing (Rust + Obj-C)
- How to represent a PTP Timestamp in c#?
- reading timestamp using Linuxptp
- Configure PTP_Timescale parameter
- ptp4l High Values of Master offset, freq and path delay
- Raspbian gphoto2: use live view and capture-image on the same camera?
- Reading ptp master offset from C code (using /dev/ptp0)
- Why TSync(Time Synchronization) is needed in Adaptive AUTOSAR?
- Android device and Unity connection failure
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
First of all, you need to understand that having MTP device name will not allow you to crawl it directories or search for images with methods you use for simple PC filesystems. It's only simplified view from Windows Explorer, not really state of things.
I don't know how exeactly do it with Delphi, but there is a Windows Portable Devices API and it all uses COM, so I beleave there is a way to get it works even on Delphi.
Another way you may try, is using libmtp it's a plain C library, you definetely can call it's dll methods from Delphi with some helper code.
If you want just names, you can find names of attached WPD devices (Windows Portable Devices, they are using MTP and PTP protocols) using SetupDiGetDeviceRegistryProperty WinApi function.
First you need to call SetupDiGetClassDevs with GUID_DEVINTERFACE_WPD (it is defined in PortableDevice.h but you can find it easy in google
{6AC27878-A6FA-4155-BA85-F98F491D4F33} )
Then iterate on devices using SetupDiEnumDeviceInfo, get id of each device from WPD cathegory with CM_Get_Device_ID function call and pass it to SetupDiGetDeviceRegistryProperty with SPDRP_FRIENDLYNAME (or SPDRP_DEVICEDESC, maybe you should try different parameters)
There are a lot of samples of using this functions, for example this one: SetupDiGetDeviceProperty usage example