How can I set a file association from a custom file type to a program - file-extension

Let's say I make a custom file that actually corresponds to what my program can read called "Bacon.dek". I can access it, modify it, etc. normally from my program, with only a few problems staying alive (fixing them at a relatively correct speed, too).
Now, what I wanna do (and try to fix rather quickly once done), is actually choosing my file from Windows Explorer, right-clicking on it, and choose "Open with..." and choose my application.
Or simply set my application as the default application to simply double-click it and it would open in my app? Like, I double-click "Bacon.dek", and it opens "Eggs.exe", reading "Bacon.dek"?

Basically you have to do this -
In registry add these keys
[HKEY_CURRENT_USER\Software\Classes\dekEditor\shell\open\command]<br/>
#="c:\path\to\app.exe \"%1\""<br/>
[HKEY_CURRENT_USER\Software\Classes\.dek]<br/>
#="dekEditor"<br/>
This is a 2 step task.First you associate your extension .dek with dekEditor (2nd entry) and then specify it in Classes(1st entry).
Answer taken from: Create registry entry to associate file extension with application in C++
MSDN Article.

Related

In Windows 10 how do I add a program to the main "Open With" menu not "Choose another App"

With Windows 7 I could easily use the Open With context menu to add a new program which would thereafter appear in the Open With menu (I can't remember the exact sequence, but it was easy and worked fine). However I have now upgraded to Windows 10. The programs that I associated with my particular file extension in W7 still appear in the Open With menu in W10. If I want to add another one I select "Choose Another App". However, any app I add with W10 does not appear in the Open With menu - I have to select Choose Another App every time to get to it. I now have two lists of available apps, one in Open With (the ones I set up with W7) and one in Open With | Choose Another App (the ones I set up with W10). It's not exactly a show stopper but it's irritating. Does anyone know what this is all about and how I can get the apps into the main Open With menu?
The reason why it doesn't appear in "Open with" menu is most likely because application's VERSIONINFO is not properly filled out with all the relevant details. If you are application developer you should create VERSIONINFO resource as clarified here:
https://learn.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource
If you are not the developer, then you can still fix this by editing registry - see here:
https://superuser.com/questions/1199648/strange-open-with-list-inconsistent-with-registry/1256482#1256482
Basically under the registry key: Computer\HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\Shell\MuiCache there should be 2 keys for YourExampleApp:
One that ends with .FriendlyAppName
One that ends with .ApplicationCompany
For example:
C:\Program Files (x86)\ExampleApp\YourExampleApp.exe.FriendlyAppName
C:\Program Files (x86)\ExampleApp\YourExampleApp.exe.ApplicationCompany
Most likely one of these 2 is missing which causes the application to be dropped out of the "Open with" menu.
The MuiCache list is cached from the properties of the application's VERSIONINFO resource embedded in the application, so if such resource is missing from the application, some items may be missing from the cache as well. For more details have a look at the above references.
Coder12345 had the correct answer for me, thanks a ton! I would like to expand on it briefly; I wanted Shotcut to appear in the first open with... context menu. I had to add the registry entry for ApplicationCompany. It appears that it doesn't matter what you put for the value of that key, just as long as it's there. No restart of file explorer was required, the change takes place immediately.
Also, the FriendlyAppName changes what text appears in the open with submenu. Shotcut appeared as shotcut.exe so I changed it to just Shotcut.

Sublime Text "Unable to save"

I didnt change any file paths and everything was working fine. I made one quick change saved it ok, did another change and I went to save it and got the following error. How can I solve this. It will save other files ok
Unable to save
D:\xampp\htdocs\websites\dev.liverpool\style\main.scss
Error:
MoveFileEx(D:\xampp\htdocs\websites\dev.liverpool\style\.sublae1.tmp, D:\xampp\htdocs\websites\dev.liverpoolzstylezmain.scss) failed,
Access is denied.
seems it's because Windows or another program is blocking the file. Sublime text uses a temporal file instead of editing the file directly, and when you save the file uses a API command to move this edited file to the original, so this command has restrictions when one file is locked and Sublime shows this alert.
Maybe this setting {"atomic_save": false} will work for you.
Go to the path where you installed sublime text 2 and...
Right click on the sublime_text 2.exe file.
Go to its properties.
Go to compatibility section under this.
Set its privilege level to "Run this program as an administrator".
Now change settings for all users and there also check the field "Run this program as an administrator".
Apply the changes.
I just solved the same issue on Sublime Text 3 beta, Stable Channel Build 3065 by doing the following under Windows 7:
Navigate to the Sublime Text 3 executable file, wherever you have it installed.
Right-click it and select properties.
Click on the tab marked "Security"
About half way down the tab, on the right hand side, under the list of group and user names is this little button:
Click it.
If your machine is setup the way I suspect it is (otherwise you probably would not be having this issue), you should be prompted for your administrator account credentials. Enter them.
Now, select the Users group in the list, then take a look in the box at the bottom labeled 'Permissions for Users'. Put a check mark in the 'Allow' column for the 'Write' item.
Click 'Apply'
Click 'OK'
You should be set. What this does is it essentially gives Sublime the ability to write files while running with regular user privileges, no administrator level access required. Upon taking a better look at your error, what is happening is Sublime Text is creating a temp file for editing, rather than editing to file itself, then attempting to overwrite the original file with the temp on save. The problem is that the program is not being run by a user with sufficient privileges to perform the overwrite, hence the failure with an 'Access denied' message.
A simple and effective solution: Right-click on the file you want to save, in my case it is index.html, go to the properties and uncheck read-only.
The Sublime text will start working fine.
I have come across this error quite many times and by un-checking read-only file attribute of index.html, I am able to get rid of it
I found out more ways to fix this:
Close and reopen the Sublime Text windows or
Open the file with Np++, add a space, save, quit, then you're prompted by ST to reload the file, click yes, and it works again... or
Open the FTP console to see if there's a transaction in progress - then cancel it
In my case the SFTP plugin seems to be causing this problem, as when the FTP connection is timed out, the file which is waiting to be uploaded is being used, and you try to overwrite it.
This happens because you're using ScoutApp or Compass, they block your SCSS files because they are checking for changes as you specified for a directory for those files.
I suggest you reading this:
http://aspirecode.com/how-to-add-sass-support-in-sublime-text/
Good luck!
On mac using a remote volume sometimes I experience this. The solution is to remove the temp file then save again and all fixed.
IE: if you are working on test.html then the temp file would be ._test.html
Remove ._test.html then save again.
For Mac-
Try changing the destination from 'Macintosh HD' to 'Documents' or any other folder.
Worked for me.
The plugin of Superlime solved this problem. It tries to save the file as root in SublimeText.
Reference Link: https://github.com/azubr/Superlime
Try switching your SublimeText process priority to higher level in process manager (it has to have higher priority than your scss compiling app, if you're using one).
It seems to have worked for me.
if it's not working after doing all suggestions, reinstall the program
On Mac I saved the file in Home directory and it gave me this alert, later when I re saved the file again this time in Document directory the file is working now. Using SublimeText 3.
I found this occurred when the folders are read-only. Right-click on the folders where your site is contained and see if read-only is selected in the properties.
Just open it as an administrator.
Because I want to edit anything and write as admin all the time, I set this program to always open as an administrator using "Configure Applications to Always Run as an Administrator".
Just got your file folder properties which you want to save and deselect to read only attribute.

Visual Studio 2012 not recognizing all pending changes?

I'm working in TFS with my team for project and the problem occurs when I'm trying to make new modeling project for my classes, it doesn't show up in pending changes.
So here is how I go:
First I enter my folder where I keep my classes. I've tried from there many combinations: I've tried first right-clicking on my folder and putting "check-out for edit" and then continued to * (see later); next I've tried clicking on .csproj of my classes so I activate my project when I'll be adding modeling project and then moved to *; last I tried to activate whole solution of our whole projects which is connecting them and then to moved to *.
None of it worked. (I was always having last version)
here is what I did next for all the possibilities:
I went to Architecture -> New diagram (named diagram and left create new project) -> Create (then windows shows up for creating new project in which folder and I always select my folder where I keep my classes).
After when that was done, I went to check to "pending changes" in Team Explorer, because there should be some available since I created already Modeling project. But there was none. Since I couldn't do it like that, the last solution how I made it was by right-clicking to Source-control Explorer on my project and going to Add items to folder and selected my project which was created locally where I wanted it to be created.
But, this last solution was giving me errors while trying to open my modeling project after. I know I should activate first modeling project, so I clicked to .modelproj and while clicking to it, it was giving me this "notice" or rather "warning":
The solution you have opened is under source control but not currently configured for integrated source control in Visual Studio. Would you like to bind this solution to source control now?
--
What am I doing wrong? Why solutions are not integrated by default while creating my project (my friends are doing it automatically, they don't need to right-click in Source Control Explorer to add item to be able to see pending changes)?
I hope I made myself understandable.
It looks like your solution binding is broken. Either click yes on the question to bind your solution to source control, this is information that must be stored in the solution file and while Visual Studio does see that the folder is mapped to source control, it also sees that your solution isn't (did you check the add solution to source control checkbox when you created it?)
Optionally try opening file -> Source Control -> (optionally) Advanced -> Manage Source Control. You can select project in your solution individually and then click the bind button on the toolbar to bind them to sourcecontrol manually.
I had a similar issue and, in my case, the solution was to right click on my project and choose Source Control->Go online. Apparently I must have somehow been switched to the offline mode.
I have successfully checked in files from source control explorer instead of solution explorer in this case. Then after that it has worked again
VIEW > Other Windows > Source Control Explorer
Other way to do it:
File--> Source Control --> Advance --> Change Source Control.
In the window displayed select all the projects you want to bind to the TFS
I had the same issue and solve it by clicking:
File -> Source Control -> Advanced -> Refresh Status
In VS2013+, you can check if your solution is online. In my case, due to VSO service outage, my solutions went offline. I had to open the solution, File > Source Control > Go Online.

MFC Application in VC++

I have developed a desktop application using MFC, which has FILE, EDIT, VIEW and HELP options,along with one pen to write on the opened document which saves as test1. It is allowing me to open only test1 or test2 etc. Apart from these types of files, if i want to open PPTs or PDFs how can i do it?
The code to open a file is autogenerated by Visual Studio 2008. Now i need to modify the same.
This is something Microsoft doesn't provide any Wizards to do (at least not directly). The basic idea is that you have to create and add new document and view classes for the new file types. Then you need to add document strings to the string table to describe the association between the file extensions and the document/view classes. Then you register each document/view pair in the app class using the strings you added to the string table.
By far the easiest way to do this is to generate the document, view, and string in another (otherwise throwaway) application, grab the document, view, registration string and registration code from that application and put them into your application. Then generate another throwaway application for the next file extension.
That gives you a skeleton doc/view for each file extension. From there, it's up to you to write the code to actually open, display, edit, save, etc., that type of file. That's not going to be trivial for either PDF or (especially) PPT -- unless you "delegate" and use something like an ActiveX control to do the real work. If you want to do that, the Adobe ActiveX control works reasonably well (somewhat limited capabilities, but it'll show up essentially the same as a PDF in a web browser). Offhand I don't remember whether MS provides an ActiveX control for viewing PPT files. There is a free PPT viewer, but if memory serves it's an executable, rather than a control.

How to place todo reminders in Dreamweaver code

I am coding in Dreamweaver for a change. Is there a way to place reminders in your code, for example in the form of a "todo list"?
I know Eclipse has this option. You can place //TODO before the line of code and the marker is placed in a list. You can view this list at will and conveniently go back to the exact spot later.
After weeks of coding I sometimes forget to take care of certain things. A todo list in the code itself would really help out, anyone know of a method for this in Dreamweaver?
Dreamweaver doesn't have a dedicated interface for viewing TODO items. However, it does have what it calls Design Notes. These notes are stored in *.mno files that are within _notes folders within the folder of the file that has a design note attached to it. These files and folders are only viewable within Dreamweaver if you have Show Hidden files enabled, which you can do by accessing the Files panel options menu on the upper right by clicking on it, then selecting View -> Show hidden files.
You have to turn them on in the site definition, although by default, a Dreamweaver site will have them turned on. The following steps are for Dreamweaver CS4:
Site -> Manage Sites..., Select the site, click Edit, select the Design notes category, check maintain design notes. Next go to the File View Columns category and make sure that the Notes column is displayed. Click OK then Done.
You can also opt to share these design notes, which means the they will be uploaded when you FTP the files to the remote site, so that others that you work with when they download the file (and assuming they also have Design notes enabled and shared), then they will be able to see that a file has a design note associated with it. Note: These *.mno files are plain text and if you your server may be accessible by others, so be sure not to put anything confidential in them.
In the Files panel, right-click on a file that you want to add a TODO item to, select "Design Notes...". In the interface that opens, you can enter in a free form note for the document. Check the Show when file is opened to cause this interface to open when you open up the file you're applying the design note to.
If you switch to the All Info tab, you can add "keyed" notes, that is a note with a name, and an associated value. This open may be good for TODO items.
When you add a design note to a file and you have the Notes column displayed, you should see an icon in the Notes column for any files that have associated notes for. Double clicking this icon will open up the Design Notes UI. This will be a quick way to determine if you have any TODOs in the files that you can see. Note: you won't see this icon for files within folders that are closed.
If you would like to do some searches or listing of files with design notes associated with them, then you can take a look at the Site Reports Design Notes report. Go to Window -> Results -> Site Reports. In the upper right of this panel, click the green arrow. This brings up the Reports interface. Select the appropriate option under Report on, and then check "Design Notes" under Workflow. Don't bother with the report settings....it's supposed to allow for some search/filtering, but I can't get it not to display all files with notes associated with them, perhaps you'll have better luck. Click the Run button and the Site Reports panel should contain a list of files that have design notes associated with them, as well as the design note info for the file. If you double click the entry, then the file will open.
Well, i use to put a simply comment like this below, directly in the php code:
//TODO: something to do here.
When i need to check my todo list, just search in the site by "//TODO:", and voilá, this is my todo list! It works, it's free and well according with KISS requirements.
Try using doxygen to document your code.
anything marks with a #todo, will be put in a special page when you generate documentaion.
Not ideal but the best i can think of.
(I haven't had much experience with dream weaver - it might have the feature you are looking for IDK)

Resources