• 0

[C#] How to create a quick launch button ?


Question

Hi,

I have a friend who is using C# to program some software. However, she wants to know how to create a quick launch button using C#.

As i do not have C# programming knowledge, thus not able to give her any advice.

I hope that i can get some answer from here.

Thanks in advance.

Nikas

13 answers to this question

Recommended Posts

  • 0
  -Alex- said:
Maybe I am missing the point, but just create a shortcut to the program executable and drop it in the quick launch folder?

yes you are, the OP wants to add a shortcut to the quick launch bar programatically, when the application is installed

  • 0

You need to add a reference to IWshRuntimeLibrary (Windows Script Host Object Model)

using IWshRuntimeLibrary;

Then add this into an event (button or something)

WshShell = new WshShellClass();
IWshRuntimeLibrary.IWshShortcut qlShortcut;
qlShortcut = (IWshRuntimeLibrary.IWshShortcut)WshShell.CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Microsoft\\Internet Explorer\\Quick Launch\\MyShortcut.lnk");
qlShortcut.TargetPath = Application.ExecutablePath;
qlShortcut.Description = "Application name, blabla";
qlShortcut.IconLocation = Application.StartupPath + @"\app.ico";
qlShortcut.Save();

  • 0

Just read this tutorial on how to do it. It explains it more :)

Create shortcuts with a .NET application

The only different is that for the full path, you need to be using

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Microsoft\\Internet Explorer\\Quick Launch\\MyShortcut.lnk"

  • 0

The correct way to do this is by using the IShellLink interface (google it :) ) and then Persist it to the Quick Launch folder (as above) by using the IPersistFile interface, though I would try that out on a non-english PC, I'm not sure if the folder name is globalized. This is exactly what the windows scripting library does except this way you are removing a totally unnessesary dependancy.

EDIT: theres even a wrapper available here :) :

http://www.msjogren.net/dotnet/eng/samples...t_shelllink.asp

Dan

Edited by dannyres
  • 0

for a basic way, set the program to reduce to the system tray. it will still open the program on mouseclick and will be minimised. this is not exactly what u asked for but it would work..

although the other previously mentioned alternatives are better.

  • 0
  Dan C said:
The only different is that for the full path, you need to be using
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Microsoft\\Internet Explorer\\Quick Launch\\MyShortcut.lnk"

You never want to hard code in english names, what happens when you use it on another language? But even then, there was a reason they didn't give you access to the quick launch area, you should let the user decide what to stick in there, not your program.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Thanks Nik and thanks Mind. Nik: Just on the off chance, you don't know where I could get this part at cheaper than normal price do you? I tried I few places but the I can find it at is 70GBP? Just gonna have to suck it up and buy the add-on for my PC. Thank you guys.
    • Underwhelming update. Same as 12,13,14,15. Then M3E ain't showing up until Q3
    • Smart Launcher seems a better option right now.
    • Mistral AI's new 'Magistral' models bring traceable, faster AI reasoning by Paul Hill One of Europe’s leading AI companies, Mistral, has announced the availability of its Magistral reasoning model. It comes in two versions: there is the open-source Magistral Small (24B parameters) and the enterprise-focused Magistral Medium. Magistral has been designed to better handle domain-specific tasks such as law, finance, and engineering. It shows users the model’s thought processes so that it’s more transparent, and it supports multilingual reasoning to perform better when tasked with answering non-English queries. Key features and performance Mistral compared its new models against DeepSeek R1 in various benchmarks. Ones that stood out were its results on AIME2024, which assesses reasoning capabilities. Magistral Medium scored 73.6% (90% with majority voting @64) while Small scored 70.7% (83.3% respectively). If you’ve used DeepSeek R1, you’ll have seen it thinking before answering. Magistral now does this too and can do it across multiple languages, including English, French, Spanish, German, Italian, Arabic, Russian, and Simplified Chinese. Interestingly, there’s also a Flash Answers mode that speeds up the thinking for 10x faster responses compared to competitors. Real-world applications and availability Thanks to the expertise Magistral has been trained on, organizations across multiple fields, including legal research, financial forecasting, and regulated industries, may be able to turn to Magistral for more reliable answers. Its traceable reasoning also makes it ideal in regulated fields for compliance and auditability. Magistral Small, the open-source model, is available under an Apache 2.0 license via Hugging Face. Magistral Medium is accessible through Mistral's Le Chat and via API on La Plateforme. It’ll also be arriving soon on Amazon SageMaker, IBM WatsonX, Azure AI, and Google Cloud Marketplace. The easiest way for readers to try it out is on Mistral's Le Chat platform; just head to chat.mistral.ai to get started. Source: Mistral
    • Didn't know this thanks, useful.
  • Recent Achievements

    • Week One Done
      elsa777 earned a badge
      Week One Done
    • One Month Later
      elsa777 earned a badge
      One Month Later
    • First Post
      K Dorman earned a badge
      First Post
    • Reacting Well
      rshit earned a badge
      Reacting Well
    • Reacting Well
      Alan- earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      544
    2. 2
      ATLien_0
      272
    3. 3
      +FloatingFatMan
      207
    4. 4
      +Edouard
      201
    5. 5
      snowy owl
      139
  • Tell a friend

    Love Neowin? Tell a friend!