Click here to Skip to main content
13,352,756 members (38,670 online)
Click here to Skip to main content
Articles » Languages » VB.NET » General » Downloads


30 bookmarked
Posted 9 Dec 2006


, 16 Dec 2006
SmartLink allows to group together the files across the network in logical folders, Groups
Imports System.IO
Imports System.Xml
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Threading

Module modMain

#Region "Variable Declaration"
    Const Add_Link As Integer = 0
    Const Linked_Files As Integer = 1
    Const Remove_Link As Integer = 2

    Public MODNAME As String
    Public FILENAME As String
    Public XMLFILEPATH As String

    Public XMLDOC As XmlDocument
#End Region

#Region "DLL Imports"
    Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias _
"ExtractAssociatedIconA" (ByVal hInst As IntPtr, ByVal lpIconPath As _
String, ByRef lpiIcon As Integer) As IntPtr

    <DllImport("user32", CallingConvention:=CallingConvention.Cdecl)> _
Public Function DestroyIcon(ByVal hIcon As IntPtr) As Boolean
    End Function
#End Region

#Region "Main"

    Sub Main()
        Dim ArgArray() As String
        Dim cmdLine As String = Microsoft.VisualBasic.Command()

        'If cmdLine.Length = 0 Then
        '    End
        'End If

        ArgArray = cmdLine.Split(",")
        MODNAME = ArgArray(0)
        FILENAME = ArgArray(1)

        XMLFILEPATH = Application.StartupPath & "\Data.xml"

        'Select Case MODNAME
        '    Case Add_Link
        '        Dim frm As New frmLink
        '        frm.ShowDialog()

        '    Case Linked_Files
        '        Dim frm As New frmLinkedFiles
        '        frm.ShowDialog()

        '    Case Remove_Link
        '        Dim frm As New frmRemoveLink
        '        frm.ShowDialog()

        'End Select

        FILENAME = "D:\DOCUME~1\SHIRIS~1\Desktop\donsrk05.rm"
        Dim frm As New frmLink
    End Sub
#End Region

#Region "Common Procedures & Functions"
    Public Sub LoadXML()
            If Not XMLDOC Is Nothing Then
                XMLDOC = Nothing
            End If

            XMLDOC = New XmlDocument

            If File.Exists(XMLFILEPATH) Then
                Dim xmlString As String

                xmlString = "<Data><Group><GroupName></GroupName></Group></Data>"
            End If

        Catch ex As Exception
            MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Function GetIconFileType(ByVal FileName As String) As Bitmap
            Dim hIcon As IntPtr
            Dim IconPic As Bitmap

            hIcon = ExtractAssociatedIcon(Process.GetCurrentProcess().Handle, FileName, 1)

            IconPic = Icon.FromHandle(hIcon).ToBitmap
            Call DestroyIcon(hIcon)

            Return IconPic

        Catch ex As Exception
            MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Function
#End Region

End Module

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Shirish Wagh
Web Developer
India India
Hey, this is Shirish a software guy by profession. Along with my hectic job schedule, I like to work on different ideas. I am in total love with all the GUI related things. I also like to work with the databases. I enjoy, to develop some simple tools which can be useful to other software professionls like me as well the normal users.

Please feel free to contact me with suggestions/ideas, at mentioned email address.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.180111.1 | Last Updated 16 Dec 2006
Article Copyright 2006 by Shirish Wagh
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid