Specify a start menu name abbreviation for ClickOnce application - c#

I would like to specify an abbreviated Start Menu name for a click once application similar to SQL Server Management Studio (SSMS) or Microsoft Test Manager (MTM). The goal is to have the ability to hit Windows key + r, type the first letter of each word in the application name, and run (ex: type 'MCD' to launch 'Model Car Designer').
NOTE: I don't simply want to change the Start Menu name.

It just boiled down to creating a new key in the registry. This blog post helped get me down the right path.
The new key I created had the same path as my application but I named the key the acronym ('MCD' in the question's example).

Related

Getting the short cut name

I have one program, the exe is called main.exe. when main.exe is excuted. I allowed the user to be able to create a shortcut off main.exe. But when the user can create any name for the shortcut. so if the user is selecting the shortcut. I need the name of this short cut. not the program its pointing to
You can't getting the shortcut name from running exe. Application does not receive information about shortcut used to launch it.
You can use command line arguments and/or current working directory to configure your application (both can be set via properties of a shortcut).

C#/Windows: Get localized default name of "New Folder"

I am using a FileSystemWatcher to check if new directories are created in the watched one. If the user creates it per Explorer -> Rightclick -> New Folder at first a directory "New Folder" is created that the user can rename instantly. Nevertheless I get the Created event on "New Folder", which I can handle.
My problem is that running the software differently localized Windows machines makes it impossible to check against "New Folder". How can I get the name of new folder as used by the explorer in the current language.
Thanks.
See these:
Find localized Windows strings
http://blogs.msdn.com/b/oldnewthing/archive/2004/01/30/65013.aspx
What you need to do is discover the "ID" of the string that is used for "New Folder"....then you can use LoadString to load it from the string table resource inside Shell32.dll.
However, the ID isn't necessarily stable and has changed between editions of Windows.
For instance...XP has the string table set up as follows:
http://www.askvg.com/customize-new-folder-and-new-shortcut-text-in-windows-xp/
On Windows 7 64 bit...the "New Folder" string has an ID of 16888.
You can try 2 different ways to do this ID discovery:
1. By discovering the ID of the "New Folder" string in advance on each edition of Windows you want to support
You would need to write a utility that just called this function on each English/US edition of Windows (XP, Vista, Windows 7, etc)...to find out the ID.
UINT new_folder_id = FindResourceStringId(shell_handle, L"New Folder", 0x409);
You can then do a switch inside your code that used the correct ID depending on the current version of Windows that is running.
2. dynamically at runtime
By looking up the "New Folder" string in the English resource to find its ID. However this would need the English MUI language pack to be installed on the system.
Use this C# code to load a particular "string" given a particular ID.
http://khason.net/blog/how-to-load-unmanaged-native-resources-from-managed-c-code/
To test if your code is working....you could install the MUI language packs and could then attempt to load the string for a different locale.
http://www.microsoft.com/en-gb/download/details.aspx?id=22108
http://support.microsoft.com/kb/972813
http://www.froggie.sk/7lp64sp1.html
http://technet.microsoft.com/en-us/library/cc766472(v=ws.10).aspx
Alternatively you could use SHChangeNotifyRegister to listen to changes made "in the shell"...Explorer calls SHChangeNotify when it does certain things.
Use the code here:
http://www.codeproject.com/Articles/3054/Shell-Notifications-in-C
Use the suitable flags e.g. SHCNRF_ShellLevel, SHCNE_MKDIR.

Set Process 'image name' and 'description' wtih C#

I want to go into as much detail as possible so this question is easily understood and answer-able
Essentially I need a way set up the process name and process description with C# on the applications startup.
Here is an example of what I would like changing;
Note: I want to set my OWN C# applications image and description with CODE.
I want to be able to change the following things in my application on startup.
Image Name in the Processes list, as well as the Description in the Processes list.
So far in my C# application i can set the process name with the properties but id rather be able to set it with some sort of code snippet (as well as the description).
I hope this has been a information question and you good clever people at stackoverflow can help.
You can't change the image name. It's the name of your executable file.
The process description, however, can be changed on your C# project assembly info:
Right click on your C# project in Visual Studio > Properties > Application > Assembly information > Title.
You can't change the description at runtime from code: the OS loads the description at startup from the Version Information file resource.
The Image Name property is the name of the executable itself (ie Foobar.exe), the Description property is the Title of the application in the Assembly Information dialogue box, as shown below:
At this point, when you run your program, you will see two entries into the task manager as shown below:
One will say the name you specified in the Title box, the other will say vshost32.exe as the description. To fix this, untick the option called Enable the Visual Studio hosting process in the project properties page.
As close as I can come to an answer is to pragmatically create a new executable with the desired name and description launch that executable then allow your launch process to die.
Try using your application as a 'host' for another app.
As soon as the application is launched, it downloads a file from a dropbox link (a direct download link) and saves it locally, (In the temp folder probably).
Then our application launches that application and then kills itself with maybe an error.
now the process running on that one would be gone, and we have a new process with our set title and description. Easy!

Strong name reusage with large number of projects

I am working for a big integration platform using Biztalk 2010 and VS2008 SSIS packages. Each interface is stored in one team project (TFS2010). On the root of the team project each interface is created with its unique name and underneath a default basic branch plan structure has been created (with Main, Dev, Release + branches when applicable, see TFS branching guideance from ALM rangers).
The issue is that each interface needs a strong name key because we want to be SCA compliant as far as possible and signing is part of the checks.
I don't want each interface to have its own strong name key, but only one strong name key for all the interfaces.
What is the best practice to handle this kind of reusable strong name key handling ?
The best practice I've found so far is this:
Create a new key file (e.g. MyProject.snk) through the VS command line, using sn.exe -k MyProject.snk - you should create the key file in the same folder as your solution.
Right click on the first project in the solution and select 'Add existing item...'
Browse to the key file you've created - do not press add - press the little dropdown icon next to it and select add as link
The key file will now be added as a link to the project - go to the project properties and your key file will now be selectable in the Signing tab.
Copy and paste the linked key file into all the other projects (this just copies the link) and select it to be the signing key for each them in turn.
This way you have the same key associated to each project, and if you ever need to replace the key, you just have to change it in one place.
Edit: Sorry - just noticed that you're actually talking about multiple solutions - I would probably still take the same sort of approach, but have the key file under source control in a centralised location. VS should be able handle this and recognise that the key file is in your workspace at a different location.
create the key with sn tool or from vs adding it to your root directory,
then every time you make a project strong named - refer to the same key file.

start .net application from start menu search

bla.exe (application alias) points to a .net application called wpfapp1.exe.
When i add a key&value to eg. this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\bla.exe
and then start application using Run -> bla.exe it starts
however when i start application using windows search i get an "windows cannot find wpfapp1.exe. make sure you typed the name correctly, and then try again."
I have successfully identified problem: this error only occurs to .net applications while native one start normally (eg. firefox.exe).
So is there any .net config that i've missed during development?
From MSDN:
The App Paths key is not used when
computing the DLL search path.
Maybe you're missing some dependent DLL...
I don't really understand your "points to" or if Windows search is specific to using the explorer search or using the start menu search.
I've had a similar problem with another application that the search could not find at all, neither in Explorer or Start menu (since it did not have an indexed folder to locate it) and solved it with a simple shortcut.
If you can create a shortcut of your application in your start menu or some other indexed folder, like a %PATH% folder, Windows search should be able to pick it up and then you can name your shortcut to whatever you want, for instance bla.exe.

Categories