Click here to Skip to main content
11,486,466 members (73,984 online)
Click here to Skip to main content
Articles » Languages » VB.NET » General » Downloads
Add your own
alternative version

SmartLink

, 16 Dec 2006 CPOL 37.9K 1.1K 30
SmartLink allows to group together the files across the network in logical folders, Groups
smartlink.zip
Setup
Debug
Setup.Exe
Setup.Ini
Setup.msi
Release
Setup.vdproj
SmartLink
SmartLink.vbproj.user
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
        frm.ShowDialog()
    End Sub
#End Region

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

            XMLDOC = New XmlDocument

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

                xmlString = "<Data><Group><GroupName></GroupName></Group></Data>"
                XMLDOC.LoadXml(xmlString)
            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
        Try
            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.

License

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

Share

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.
shirish.wagh@yahoo.com

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