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
- Delphi BDE with connection to Oracle access violation
- I'm getting "Socket Error # 10054 Connection reset by peer" in Indy using TIdHTTP to GET an HTTPS url
- Why the EN_PROTECT notification message is not sent to the RichEdit?
- How do I implement SSL in Delphi to connect to a REDCap API server?
- How to connect Delphi mqtt client securely to an mqtt broker?
- Upload files with Delphi XE7 TRESTRequest without AddFile
- Can Delphi Indy Ftp idFTP.GET Preserve the File's Created and Modified Date?
- Inserting a row to Dataset has unsual delay at Delphi Alexandria 11.1 when load a big lookup Fields
- In Delphi XE7 when running a program in the IDE cannot create a log file, but it works when I run the created exe
- LoadVM Java VM with JNI - access violation
- Reading thread's fields from synchronized event handler
- How to convert the numeric keypad dot-key into the DecimalSeparator?
- delphi convert set type to array of character
- Using TArray.Copy with generics arrays
- OleContainer For MS Word
Related Questions in MTP
- Mounting device as mass storage instead of mtp
- How to detect MTP slave mode on Android
- How to make Android MTP file transfer work again
- How to turn on usb charge only mode programatically if the mode is file transfer in android?
- Windows 10 can't replace a deleted file on some Android devices' data directory
- Programtically ask explorer to refresh Portable device folder contents
- Android MTP Device mode communciate with host?
- Accessing an image from storage of a plugged in Android phone, on Windows with Python
- libmtp on mac os can not connect using mtp-connect
- How to pass an android phone (MTP-USB) to a virtual machine using QEMU/KVM?
- How to Copy Files to Android MTP by python?
- Internal Storage and SD Card sector Read/Write for MTP connected android device in C/C++
- Playing media from external device with python-vlc on linux
- Download file from MTP connected device with Python on Ubuntu
- Recognize internal storage of portable device through MTP in C#
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 # Hahtags
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