Is there a way to obtain a list of registered file extensions/types from Windows? Maybe GetExts('Video')?
Delphi: obtain list of file extensions by type
347 Views Asked by ZJ Green 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 WINAPI
- How to immediately apply DISPLAYCONFIG_SCALING display scaling mode with SetDisplayConfig and DISPLAYCONFIG_PATH_TARGET_INFO
- Changing the theme of a #32768 (menu) window class at runtime
- Issue with GetOpenFileName while debugging
- How to populate a ListBox with SendMessage?
- Is there a function to end a child process?
- HDR video publishing
- Frameless Qt + WinAPI maximized window size is bigger than the availableGeometry()
- Mount .iso file with python
- What is Win32 x86-64 CONTEXT::VectorRegister for?
- WinAPI - right mouse drag & drop and IContextMenu
- Win32 per-filesystem cache tuning?
- Client connection timeout during Android & Windows PC communication via sockets
- MessageBoxEx sometimes shows as hollow window, border only, and only on Windows 11
- Win32api send message and Pydirectinput and Powertoy (Keyboard Manager ) Not working when open the application
- Would it be possible to run an application right after csrss.exe loads? (Windows)
Related Questions in FILE-EXTENSION
- How to detect file open requests from Explorer in Delphi?
- My compiled file doesn't have an extension
- Set default windows app for common middle extension but different last extension
- How can I make my app accept certain photos file extensions?
- Assign filetype to a software by script
- Keep Python code safe from execution by Pydoc
- Error: Unknown file extension ".ts" when using Express and TypeScript with Nodemon
- Making a Chrome extension to read custom file types
- "Unknown file extension" error with Nuxtjs/google-fonts package
- sending a docx but detected as application/x-tika-ooxml instead of "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
- What is the name of this package(plugin) in Sublime Text?
- How to Creating a New File Context Menu for Blank (No Extension) File or your own Custom File Extension
- How to change the name of an extensionless file
- How can I write a VSCode extension that selects the type of file I am writing in based on my own commands?
- How to rename a File via a batch-file but keep the file extention
Related Questions in FILE-TYPE
- How to use file-type in Vue 3?
- Wordpress enable php filedownload for users
- nodejs 'file-type' and 'mime': require() of ES Module is not supported; change index.js to a dynamic import() which is available in CommonJS modules
- Micro services with Minio implementation
- How to automatically set Brotli encoding in Azure Blob storage?
- R proFIA "No MS1 data found in file" error using MSConvert-ed files
- MS-DOS D-Fend Reloaded file encoding "application/octet-stream; charset=binary" to ASCII in ubuntu
- Assign filetype to a software by script
- How can I upload .rvt (revit) files to Wordpress?
- .eml files not getting uploaded while sending it from email to databse
- How To Get Only Certain Object Types Back From Git LS-Files
- linux shell CLI file get mime-type from a string variable
- How do I solve the "is not a path to a .klc file" error in Windows PowerShell when running a klc to tfl file converter script?
- macOS document based app - save all documents as one
- What are the .rxxxxk .rxxxxl file extensions?
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?
File formats
File formats by far not only belong to one category only - most formats which people call "video" are in fact containers (because they can carry more than video only, like: audio, subtitles, menus...). They are unbound to filenames, because filenames can have any form:
music.mp3its actual content is not guaranteed to be MPEG-1 audio, and.mp4,.m4v,.m4aor even.co.uk.How are filename extensions stored (in Windows)?
As per File Types the Registry stores them this way, which happens at least since Windows 95:
...whereas:
The latter eventually leads us to
AssocGetPerceivedType(), but that function is only useful when we already know a filename extension. Most likely it's just a wrapper for reading the Registry keys and values.So all we have to do is to:
HKEY_CLASSES_ROOTkey for all keys that start with a dot, andContent Type(can have something likevideo/mpeg) and/orPerceivedType(can havevideo).MIME database in Registry
As per Remy Lebeau and Is there a way to get an extension for a given content type? also this structure exists:
This seems to be the Internet Explorer MIME Database as mentioned in Best Practices for File Associations. For every key that starts with
video/we could read its value with the nameExtensionto then know the filename extension. That should already exist as a key in theHKEY_CLASSES_ROOTroot, tho, and not be something new that we'll find.In Pascal
Delphi already comes with the wrapper class
TRegistryfor those not wanting to deal with the WinAPI functions directly.Results and completeness
For me this produces (excerpt):
However, it won't list
.mkv&.webm,.ogm&.ogv,.flv,.bik, because neitherContent TypenorPerceivedTypeexists.xvid, because the key doesn't even existThis is because an individual Windows installation doesn't come with knowing all formats. Not few formats are defined by either doing that manually, or by installing player software which does that automatically for all the formats it supports. Hence, this code will produce different results for everyone.
Further reading
A complete list of formats doesn't exist, because also many proprietary formats exist which are only used on software products (such as animations and videos within games) without any intention to be used outside of that scope. And then there are edge cases when animations are still rather a picture than a video (such as
.gifand.mng).