473,796 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get icons of shortcuts(.lnk) without error?

I would like to display the shortcuts in a folder on my C#
application. Of course I would like the linked application to be
executed when the user double click on a icon.

To do so, I need to be able to get the icon and the target path
from .lnk files. I've searched Google and found that many pages lead
to http://www.msjogren.net/dotnet/eng/s..._shelllink.asp.
The sample program looked fine and I thought it would give me all the
things I wanted. BUT, I think that sample program has some bugs. It
didn't always display icons for all .lnk files. For some .lnk files,
all other information were displayed correctly but the icon was not
displayed.

Is there a 100% working way of getting icons from .lnk (shortcut)
files?

Mar 17 '07 #1
0 1529

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1244
by: TC | last post by:
I know .NET setup projects use "Windows Installer" shortcuts instead of ordinary shortcuts, but I'm having trouble with those, so I'd like to hard-code some ordinary shortcuts in the user's start menu. The problem is, the setup project will let me put every kind of file in the start menu except .lnk files. The one file type I need is the one file type which seems to be rejected. Perhaps there is some trick I don't know about. For the...
3
5637
by: Stanislaw Findeisen | last post by:
Does anyone know how to create file shortcuts in Windows? The only way I know is like: --------------------------------------------------------------- import win32com.client wScriptShellObject = win32com.client.Dispatch("WScript.Shell") shortcutName = unicode("shortcut.lnk", "utf8")
1
1923
by: Jeti [work] | last post by:
How to read information from .lnk file? I'm interested in "Target" and "Start In" properties... thanks
0
1039
by: Rui Oliveira | last post by:
I am using a tree from CTreeCtrl. To create the imagelist I am using a bitmap with 256 colours. But the icons in my tree only appear with 16 colours. What is supposed to do to have icons with 256 colours in tree? This is my code: -------------------------------------------------------------
1
1997
by: noleander | last post by:
Hello. Ive got a VC++ program. Inside the program Ive got some code that has a full file path: C:\aa\bb\cc\dd\file.txt One of the folders in that path (cc) is a shortcut pointing to some other folder far away. The program doesnt seem to follow the shortcut. Im used to Unix, where shortcuts are indistinguishable from folders (or files) and you cannot have a
4
12476
by: garyusenet | last post by:
I want to write a quick and simple programme to update a shortcut on about 20 peoples workstations. They will all have the same shortcut, so I thought the simplest way would be to create the shortcut on one computer and just copy it to their desktops. However I would like to add two extra features to this. 1. I would like to log when the users use the programme. I will just create a network text file and append a line each time the...
6
9295
by: Cross | last post by:
Is there anyone who knows how to parse a windows shortcut (lnk file) on the start menu? How hard could it be, it is just a few values, like Target file, Icon file... I search for in on Internet for a while, but I did not found anything. So what I want is the sourse code for a shortcut parser, written in VB.net if possible (C# would be ok), or at least the specification for how a shortcut (LNK file) is build, so I can writ one myself. ...
4
2497
by: David Jackson | last post by:
Hello, I've been asked to write a sort of "desktop clean-up" utility. Requirements are simple: iterate through the shortcuts (*.lnk files) on the currently logged-on user's desktop, and delete each link whose TargetPath property no longer exists. Iterating through the shortcuts on the desktop is easy enough using Directory.GetFiles(*.lnk)
6
5882
by: Joe Duchtel | last post by:
Hello - I'm trying to put together a little VB .NET (1.1 in VS 2003) application that lets me substitute the path in the Target: and Start in: fields of *.lnk files. Is there any way to do that? I saw examples of VBScripts using WSH but I would like to do it in VB .NET. Is support for *.lnk built into .NET? Thanks,
0
9683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10457
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10231
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10013
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6792
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.