Adding app shell item to Windows Device notification dialog - shell

I don't really know what they're called, but I'm referring to the window that pops up when you connect, lets say, a thumb drive.
These notification dialogs have a list of application that you can choose to open in order to do some actions regarding that device. (what are those notification dialogs called? I couldn't find anything about it)
The question:
How do I add such an item to those notification dialogs?
My guess is that a regkey is added.

You can change the "Open With" dialog from the registry. It is located here:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
Then you open the folder with your extention and then the "OpenWith" folder. Then add or remove your program.
The whole process are described in details here:
Add or Remove Programs in the Open With Menu From the Registry

Related

Remove all related mail files within Windows 7

I have windows 8 machine and I will give my pc to company owns it. The thing is I dont want anybody able to see my "old" e-mails. I removed from these e-mails in Outlook but:
when I click windows icon left bottom and type somethings related with a deleted mail, it appears in there..(when I try to open it it propt a msg that it is deleted and ask me to remove shortcut too.)
So I want to delete all these fiels completely and not able to see anything about them it musnt be able to search by somehow..
I dont want anything exist about that files in pc
Edited:
I click and view properties of that file appears on windows start bar it located in
"C:/Users/10023213"
so I would think to delete this directory but there is also "AppData" file in it which used by other stuff.. I couldnt figure it out how to remove things about only e mails once for all
Close Outlook.
Go into Control Panel, and in the search box at the top choose Mail (or Mail (32-bit)).
Click the Data Files... button, highlight your name in the list, and then click the Open File Location button, which will open Windows Explorer. Leave Explorer open, but close the Data Files dialog.
Click the Show Profiles... button, where you should see Outlook or your profile name. Select it and click Remove.
Close the Mail control panel dialog. Go back to the Explorer window you left open before, and delete the youremail#yourmailhost.ost file, which is all of your email content (inbox, sent, etc.). You may want to delete all of the other files and folders in this folder, as they're all of your Outlook related info (address book, etc.).

How to define which shortcut appears on the Start Menu after installing?

I'm working on a Windows Setup Project in Visual Studio. In the "File System" editor, below the "User's Programs Menu" node, I have a folder for my application that contains several shortcuts. One shortcut serves to launch the application; a different one restores the application's factory settings (so it also calls the application, but with an argument).
After running the installer, the folder - and shortcuts it contains - are created correctly in the Start Menu. Additionally, without any action on my behalf, the installer creates an additional shortcut at the "top level" of the Start Menu (i.e. it's visible when one opens the Start Menu by clicking the Start button).
This additional shortcut used to be the one for launching the application. That was fine. But since I added the "Factory reset" shortcut, this is the one that appears at the "top level" of the Start Menu. This is pointless, and will just confuse users. Is there any way to change this?
EDIT (clarification): Since I added the "Factory reset" shortcut, only this shortcut appears at the top level of the Start Menu (which I don't want), and the shortcut to launch the application no longer appears (but I want it to). Note that all shortcuts in the Start Menu's subfolder are correct. What I'm referring to here is the single shortcut that appears automatically at the top level of the Start Menu (immediately visible when the Start button is clicked).
You'll have to explicitly mark your "factory reset" shortcut with the System.AppUserModel.ExcludeFromShowInNewInstall property. Raymond Chen shows how to do this in this blog post.
Note that this question was asked before.

How to associate an extension with a program if the extension is not in the "Default Programs" list in Windows Seven?

In Windows Seven, I'm aware of the "Default Programs" dialog in Control Panel, which lets me associate pre-defined extensions with programs. However, I need to add an association for a file extension that isn't in the list. In WinXP, I'm pretty sure I could add entries to the list, but that doesn't appear to be immediately available in Windows Seven.
If you select a file with the desired extension in Explorer and click on it, a dialog box pops up that lets you select a program from a list. Click that. Then you can CLick on "Browse..." and select the program you want the file to be opened with. I have not tried, but you might be able to change it through the Default Programs afterwards.

Document icon changes after first launch on Windows

I have an application that gets installed with a Wise installer (EDIT: Wise creates a Setup.exe file, not an MSI). Upon installation, an icon is set for a certain file type:
HKEY_CLASSES_ROOT\.auz\DefaultIcon = C:\Path\To\App\some_icon.ico,0
Right after the installation, however, Explorer chooses to display this icon using the generic "white sheet + application icon" icon, which is different (and not provided by me).
Upon first launch, the application itself registers icons and other file associations, so that the last run version "owns" those documents. At that point, Explorer changes the icon for this file type and displays the correct one, but when I look at the registry, the value for DefaultIcon is exactly the same.
This is what I've tried so far
Removing all entries from the registry, and writing them myself.
After the installation, "touching" the value of DefaultIcon, and then launching a small little program that only calls SHChangeNotify(SHCNE_ASSOCCHANGED) (my program does this after updating the file associations in the registry).
After the installation, killing and restarting Explorer.
After the installation, using TweakUI to "repair" the icons on the desktop.
None of these work. The only way to get the correct icon is to let the program itself install it. I can't find any change in the registry. I'm pulling my hair off.
What I would like to avoid
Testing with another installer software
Changing the installation script too much (I don't have Wise itself, as the installer gets built on another machine on demand).
Embed the icons in the executable.
Any suggestions on how to get Explorer to display the correct icon after installation?
A couple of things come to mind:
why do you have the ',0' after the icon in the registry? That would limit the shown icon to one single icon. Better would be to have an icon file which contains several icons (same icon UI but different sizes/color depths) - Explorer has different icon views! Try removing the ',0' if your icon file only has one icon in it.
it may be that the registry is written last in the installer, after the explorer got notified of updates?
make sure the registry entry is written after the icon file is stored on disk
you should use the Wise installers own configuration to register the file type. Not sure, but I think explorer won't take any changes until the whole installation of an msi is finished, so calling SHChangeNotify() manually won't help. The msi has its own table for this, which Wise will add if you use the right configuration.
For Wise, do the following (instead of creating the registry keys on your own):
Under the Feature Details page group, select the File Associations page.
From the Current Feature drop-down list, select Core.
Click Add at the right of the window and select New.
The File Association Details dialog appears.
Click the Extension Details tab.
Browse to the QuickFacts directory, select the file QckFacts.exe, and click OK.
In Extension, enter: qft
Leave the defaults for the rest of the fields and click OK.
The extension .QFT is added to the installation. When an end user double-clicks a
file with this extension on the destination computer, the QuickFacts application
launches.
Save the installation
[Edit]
You may also missing required registry entries (the icon might not be enough for the shell to show it):
HKEY_CLASSES_ROOT\.auz\(default) = auzfile
HKEY_CLASSES_ROOT\.auz\shell\open\command = C:\Path\To\App.exe
Here's the solution.
Each file type (let's say ".auz" in this case) was registered with:
A DefaultIcon key with the path to the icon resource, and
A value for the HKEY_CLASSES_ROOT\.auz\(default) value giving a description of the file type, e.g. "Foobar Document".
In addition to this, there was an entry for the "Foobar Document" document type, or more specifically, a key for how to open such documents from the shell:
HKEY_CLASSES_ROOT\Foobar Document\Shell\command\open\(default) = C:\Path\To\App.exe "%1"
Apparently, this key supersedes the value written for the specific file extension. Because the icons are external to the .exe file, Windows Explorer then used the first icon of the application to create an icon for all files of type "Foobar Document" (that "white sheet + application icon" icon I mentioned).
Now, what I had wrong was that the application itself does change the value of
HKEY_CLASSES_ROOT\.auz\(default)
to a slightly different value when starting, say "Foobar 1.2 Document" (the problem with not being DRY). Thus, the link to "Foobar Document" was lost, and the .auz files got their icons after the first launch.
So I fixed this all by simply removing the HKEY_CLASSES_ROOT\Foobar Document key altogether, and voilĂ !

Adding item to the Desktop context menu in Windows

I want to add an item into the Desktop context menu (the menu you see when you right-click on an empty space on the Windows Desktop).
Something like Catalyst Control Center in this screenshot:
I know how to add items to files' and folders' context menus through registry, but the Desktop seems to work differently: I didn't even find the text in the registry.
So, how can I add a new item into the Desktop menu and how can I associate some code with it?
I think the solution is language independent, if it's not, I'd appreciate any code that helps.
Such a handler must be registered in HKCR\Directory\Background, instead of usual locations like HKCR\Directory, HKCR\Folder, etc.
Check out Creating Shell Extension Handlers in MSDN.
There's a series of articles on CodeProject that details writing Shell Extensions and is very good:
http://www.codeproject.com/KB/shell/shellextguide1.aspx

Resources