Robjong Posted August 11, 2007 Share Posted August 11, 2007 Hi, If you open a .txt file it will open with notepad for example, notepad reads the content and displays it. To make a certain extension open with my program i found a script on the forum. If I set .txt files open with myApp.exe then double click myFile.txt it starts myApp.exe, now how can you make myApp.exe read myFile.txt and display the content in a edit box? ---------------- Robjong Link to comment Share on other sites More sharing options...
Kip Posted August 11, 2007 Share Posted August 11, 2007 (edited) Run > Regedit > HKEY_CLASSES_ROOT EDIT: if you wait just a sec i'll write a example for you Edited August 11, 2007 by kip MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Kip Posted August 11, 2007 Share Posted August 11, 2007 (edited) here you go: $Ext = InputBox("file types","wich type do you want to associate? (.txt, .au3 etc)") $Name = InputBox("file types","Name of your program:") $Path = InputBox("file types","Path to your program: (C:\myprog.exe)") RegWrite("HKEY_CLASSES_ROOT\" &$Ext& "\OpenWithList\" & $Name , "") RegWrite("HKEY_CLASSES_ROOT\" &$Name& "\shell\open\command", "","REG_SZ","""" & $Path & """ %1") MsgBox(0,"file type","if your file is runned, then the full path to that file is send to the first command line($CMDLine[1]) of you program" &@CRLF& "You must reboot first") #cs uncommand this to set an default icon for your files $ico = InputBox("file types","full path to your icon: (C:\myimg.ico. must be an .ico)") RegWrite("HKEY_CLASSES_ROOT\" &$Name& "\DefaultIcon", "","REG_EXPAND_SZ",$ico) #CE Edited August 11, 2007 by kip MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Robjong Posted August 12, 2007 Author Share Posted August 12, 2007 Hi again,Thanks kip, that was exactly what i needed Link to comment Share on other sites More sharing options...
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