Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Create ICONS on DESKTOP or Start Menu or Under Sta...
Author:
Gagan Bhargava
E-mail:
Click to e-mail author
Submitted:
10/16/2001
Version:
VB6
Compatibility:
VB6
Category:
Forms
Views:
16732
Create ICONS on DESKTOP or Start Menu or Under Start->Programs
Declarations:
'For Creating an Icon U need to add a Reference to Windows Script Host Object Model (Ver 1.0) 'Click Projects -> References 'Now select Windows Script Host Object MOdel (Ver 1.0) and click OK 'Now Add the following Code Dim wShell As New IWshShell_Class Dim wShortcut As IWshShortcut_Class
Code:
Private Sub CreateIcon() 'This will Create an ICON under Start->Programs-> with the Name TEST 'If U want UR Icon to be only under the START MENU then change wShell.SpecialFolders.Item(2) with wShell.SpecialFolders.Item(1) below 'If U want UR Icon to be on the DESKTOP then change wShell.SpecialFolders.Item(2) with wShell.SpecialFolders.Item(0) below Set wShortcut = wShell.CreateShortcut(wShell.SpecialFolders.Item(0) & "\" & "Test.lnk") 'The Target Path is the Application name for which U want UR ICON to REFER TO. 'Make sure U refer the Application Name and the Correct Path wShortcut.TargetPath = "C:\SomeEXE.exe" wShortcut.Save End Sub Private Sub Form_Load() Call CreateIcon End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement