Mat Posted April 16, 2009 Posted April 16, 2009 (edited) It is fairly common knowledge that you can create file types such as .au3 in the registry, and also that you can make context menu items by writing to shell\command too. This is just a UDF I put togethor that does just that!***Functions:**** RegCheckExtChecks to see if a given extension is valid, and returns accordingly, also returns though if the extension is valid as a file type, so you can check if AutoItScript is valid. It also runs a check if all else fails to see if it would be valid if you add a dot to the front, so you can search for just au3, and it will return.* RegGetFileTypeGets the filetype from an extension, so if you type .au3, will return with autoit3script. It also validates the answer to make sure that the filtype exists, and hasn't been deleted.* RegCreateExtCreates a file type and an extension as well as associating an icon with it. I have made an extension on my computer specifically for testing the features listed here called .test, the file type is testing file, description is a file for testing stuff, etc.* RegRemoveExtRemoves an extension and its corresponding file type from the computer, this can cause havoc if you let it, as youi can delete any extension, and end up with the computer not recognizing (and not being able to do anything) with .txt files or .doc etc.* RegCreateContextItemCreates a context menu item under the specified extension/filetype. you can use this to say add Open to a .test extension, set the command to notepad.exe and params to %1.* RegRemoveContextItemRemoves all entries for a context menu item, a very simple code, that like regremoveext, can cause a fair bit of trouble on your pc, if you know what the command is though, then you can just remake it with RegCreateContextItem.* RegGetContextDefaultReturns with the default action on double clicking a file with the specified extension/file type.* RegGetContextAllReturns an array with all the context menu of a given extension. This is not neccesarily all of them though, to get a full list, do another search for all context items under an extension of "*".Thanks to the saint who sent me his script that he used to make .tale files for tall tales, they helped a lot! Download LinkDownloads so far shown on the downloads page.I also threw togethor a couple of GUI's that show the kind of stuff you can do, I was contemplating writing a full suite, but times a major factor, and cba. These GUI's require that the udf is put in the includes folder.Oh, and forgot to add: for the first GUI, the icon doesnt' change... I need to sort that one out, GUICtrlSetData doesn't seem to work with an icon...There will as always be errors, so sorry, just post the error and a if you feel like being nice, a script to solve it, and I will upload the edited version.Have a nice day!MatUpdated download link @ 12 March 2010 Edited March 12, 2010 by Mat AutoIt Project Listing
KaFu Posted April 16, 2009 Posted April 16, 2009 Nice idea, didn't test it (yet), but for sure will do . Thanks for your efforts! OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Mat Posted April 16, 2009 Author Posted April 16, 2009 Nice idea, didn't test it (yet), but for sure will do . Thanks for your efforts!Thanks!Does anyone know if there is a way i can write to the context menu's of windows? and possibly return the title or even better, the handle as a parameter? that could be good! AutoIt Project Listing
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now