This is very simple.A call to WNetGetConnection API returns the UNC name for any drive letter, most drives typically are not mapped.
I've put together a loop that calls a DriveLetterToUNC function on each letter of the alphabet from C to Z,prepares an adequate buffer by creating a string that's MAX_PATH characters long, then passes this string with the buffer length and drive letter to WNetGetConnection.
Your code extracts the UNC name from the buffer by scanning for the first Null character and trimming just before it.
Convert mapped drive to UNC
Discussion about anything that might be of interest to MediaMonkey users.
Moderator: Gurus
-
hostonmark
- Posts: 2
- Joined: Mon May 03, 2010 11:25 am
Return to “News and Other Stuff”
Jump to
- MediaMonkey desktop (v5 / 2024 / 2027)
- ↳ Need Help - MMW
- ↳ MediaMonkey for Windows - Beta testing & feedback
- ↳ MediaMonkey for macOS - Beta testing & feedback
- ↳ Need Help with MMW Addons?
- ↳ MediaMonkey for Windows developer forum
- ↳ Alpha testing, bugs, and feature requests (MM Server)
- MediaMonkey for Android
- ↳ Need help (mma)
- ↳ Beta Testing, Bugs & Feature requests (mma)
- General Discussions
- ↳ News and Other Stuff
- ↳ Off Topic
- Foreign Language Discussions
- ↳ Deutsches Forum
- ↳ Forum Francais
- Contributions
- ↳ Localization
- ↳ Artwork
- MediaMonkey 4 for Windows
- ↳ MediaMonkey for Windows 4 Beta Testing
- ↳ Need Help? (MMW4)
- ↳ Need Help with Device Synchronization? (MMW4)
- ↳ Need Help with UPnP / DLNA ? (MMW4)
- ↳ Need Help with Addons? (MMW4)
- ↳ Bug Reports (MMW4)
- ↳ Wishlist (MMW4)
- ↳ MediaMonkey 4 Addons developer forum
- MediaMonkey for Windows 8/RT (metro) - LEGACY
- ↳ Need help? (mm8)
- ↳ Bug Reports (mm8)