473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Create Desktop Icon

I am trying to create a desktop icon using VB6. is this possible?

-p
Jul 17 '05 #1
5 26968
http://www-level3.experts-exchange.c..._20710687.html

gl,
Henk
"Eskimo Joe" <jo*@joe.com> wrote in message
news:nEenb.42869$B_2.28773@okepread02...
I am trying to create a desktop icon using VB6. is this possible?

-p

Jul 17 '05 #2
What exactly are you trying to achieve? Have an icon for one of your
programs on the desktop?
Or write a VB program to create icons?

Option 1 - you dont need to use VB
Option 2 - lots of products out there already

"Eskimo Joe" <jo*@joe.com> wrote in message news:<nEenb.42869$B_2.28773@okepread02>...
I am trying to create a desktop icon using VB6. is this possible?

-p

Jul 17 '05 #3
if you'd like to use some code to do it, check here...

http://www.mvps.org/vbnet/index.html...esktoplink.htm

D.
Samuel Hon wrote:
What exactly are you trying to achieve? Have an icon for one of your
programs on the desktop?
Or write a VB program to create icons?

Option 1 - you dont need to use VB
Option 2 - lots of products out there already

"Eskimo Joe" <jo*@joe.com> wrote in message news:<nEenb.42869$B_2.28773@okepread02>...
I am trying to create a desktop icon using VB6. is this possible?

-p


Jul 17 '05 #4
'This quick routine will create a shortcut to the Desktop, The StartMenu and
the Startup folder without the use of the Windows API. The example also
shows a method of deleting the shortcuts.
Public Sub CreateShortcut()
Dim DT As Integer 'Desktop reference integer
Dim ST As Integer 'StartMenu reference integer
Dim WshShell As Object
Dim oShellLink As Object
Dim sStartMenu As String 'Container for Start Menu location
Dim sStartup As String 'Container for Startup Menu
location
Dim sDesktop As String 'Container for Desktop location
Dim sWindows As String 'Container/Identifier for OS folder
location

Set WshShell = CreateObject("WScript.Shell")
'Define the folder as StartMenu
sStartMenu = WshShell.SpecialFolders("StartMenu")
'Define the folder as Startup
sStartup = WshShell.SpecialFolders("Startup")
'Define the folder as Desktop
sDesktop = WshShell.SpecialFolders("Desktop")
'Define the location of the application
sWindows = App.Path

'Create Desktop shortcut:
' DT represents a True/False value of a checkbox to Add or Delete the
shortcut
If DT = 1 Then
Set oShellLink = WshShell.CreateShortcut(sDesktop &
"\Stickems.exe.lnk")
oShellLink.TargetPath = sWindows & "\Stickems.exe"
oShellLink.IconLocation = sWindows & "\Stickems.exe, 0"
oShellLink.Description = "Stickems shortcut"
oShellLink.WorkingDirectory = sWindows
oShellLink.Save
End If

'Create ShortCut in Start Menu.
' ST represents a True/False value of a checkbox to Add or Delete the
shortcut
If ST = 1 Then
Set oShellLink = WshShell.CreateShortcut(sStartMenu &
"\Stickems.exe.lnk")
oShellLink.TargetPath = sWindows & "\Stickems.exe"
oShellLink.IconLocation = sWindows & "\Stickems.exe, 0"
oShellLink.Description = "Stickems shortcut"
oShellLink.WorkingDirectory = sWindows
oShellLink.Save

'Create ShortCut in Startup Menu.

Set oShellLink = WshShell.CreateShortcut(sStartup &
"\Stickems.exe.lnk")
oShellLink.TargetPath = sWindows & "\Stickems.exe"
oShellLink.IconLocation = sWindows & "\Stickems.exe, 0"
oShellLink.Description = "Stickems shortcut"
oShellLink.WorkingDirectory = sWindows
oShellLink.Save
End If

Set oShellLink = Nothing
Set WshShell = Nothing
End Sub
'This Procedure will Remove the icon from your Desktop.

Public Sub Check2_Click()
On Error GoTo ErrorHandler

If Check2.Value = vbUnchecked Then
ST = 0
Kill sStartMenu & "\Stickems.exe.lnk"
Kill sStartup & "\Stickems.exe.lnk"
ShortCut = "False"
Exit Sub
End If
If Check2.Value = vbChecked Then
ST = 1
CreateShortcut
ShortCut = "True"
End If
Exit Sub
ErrorHandler:
End Sub
"Eskimo Joe" <jo*@joe.com> wrote in message
news:nEenb.42869$B_2.28773@okepread02...
I am trying to create a desktop icon using VB6. is this possible?

-p

Jul 17 '05 #5
Do you mean a Desktop shortcut?
There's a very basic class, named SHELLLNK.CLS, in
the tools\unsuppported folder of the VB CD. There's
also a smalll TLB with it. Set a reference to the TLB
and add the class to your project. You'll then have a function
for making shortcuts.

--
--
Eskimo Joe <jo*@joe.com> wrote in message
news:nEenb.42869$B_2.28773@okepread02...
I am trying to create a desktop icon using VB6. is this possible?

-p

Jul 17 '05 #6

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

Similar topics

1
by: Bodi | last post by:
Hello, Could someone please tell me if there is a way, or how do I change my html/javascript so that if I drag and drop a link from a webpage to the desktop in such a way that the name of the...
3
by: Bodi | last post by:
Hello, Could someone please tell me if there is a way, or how do I change my html so that if I drag and drop a link from a webpage to the desktop in such a way that the name of the shortcut...
4
by: blagdam | last post by:
Is it possible to launch a functional Access 2000 db switchboard by clicking on a desktop icon? I have searched the Microsoft Knowlege Base but, apparently I'm not phrasing my search in the...
1
by: | last post by:
I need to let the user know what state a certain property had the last time the program was run. Is there a way to have the application itself change the desktop icon used to start the program. I...
3
by: Michael D. Murphy | last post by:
Hi, I am searching for a way to creat desktop shortcuts when running the setup files that were created within a VB solution using the setup wizard. Thanks, Michael
2
by: Rob R. Ainscough | last post by:
I've setup a Windows Installer Setup Project for my VS 2005 VB.NET app -- it installs find, but my Desktop icon and Programs Menu icon do not run the app ..exe when I click on them -- I can't...
0
by: Steve | last post by:
After installing my application (which I developed using Visual Studio 2005) on a target desktop, the desktop icon shows the icon that is assigned to the application exe - which is what I want. ...
1
by: Steve Richter | last post by:
can a desktop icon, used to launch an application window like windows explorer, be a child control in a window form? I checked the windows forms controls in VS2005 and did not see any such...
2
by: Lysander | last post by:
This is a strange one. I am running MS-Access 2003, under Windows XP and have many desktop shortcuts, used to pick up the correct mdw file. An example would be called "Champion System" and have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.