DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    MaRiØ Guest

    DefaultIcon in a file asociated with my program


    I´ve created a file association to my app, when I click the file, my
    app launchs OK.But the file don´t show the ICON that I push in Registry
    What´s the problem??

    sKeyName = "CIMDFile"
    sKeyValue = "bla bla bla"
    ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
    ret& = RegSetValue&(lphKey&, "", REG_SZ, sKeyValue, 0&)
    ' fILE extension sKeyName = ".cim"
    sKeyValue = "CIMDFile"
    ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
    ret& = RegSetValue&(lphKey&, "", REG_SZ, sKeyValue, 0&)
    ' executable path
    sKeyName = "CIMDFile"
    sKeyValue = App.Path & "\" & "CIMDApp.EXE ""%1""" 'parametters
    ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
    ret& = RegSetValue&(lphKey&, "shell\open\command", REG_SZ, _
    sKeyValue, MAX_PATH)
    ' icon
    sKeyValue = App.Path & "\Ani\CIMDFile.ICO"
    ret& = RegSetValue&(lphKey&, "DefaultIcon", REG_SZ, _
    sKeyValue, MAX_PATH)

  2. #2
    Dean Earley Guest

    Re: DefaultIcon in a file asociated with my program

    You have created a string value called DefaultIcon. You need to create a Key and set the default string value

    --
    Dean Earley (dean.earley@icode.co.uk)
    Assistant Developer

    iCode Systems
    "MaRiØ" <mgonzalez@grupocimd.com> wrote in message news:3bcfdd97$1@news.devx.com...
    >
    > I´ve created a file association to my app, when I click the file, my
    > app launchs OK.But the file don´t show the ICON that I push in Registry
    > What´s the problem??
    >
    > sKeyName = "CIMDFile"
    > sKeyValue = "bla bla bla"
    > ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
    > ret& = RegSetValue&(lphKey&, "", REG_SZ, sKeyValue, 0&)
    > ' fILE extension sKeyName = ".cim"
    > sKeyValue = "CIMDFile"
    > ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
    > ret& = RegSetValue&(lphKey&, "", REG_SZ, sKeyValue, 0&)
    > ' executable path
    > sKeyName = "CIMDFile"
    > sKeyValue = App.Path & "\" & "CIMDApp.EXE ""%1""" 'parametters
    > ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
    > ret& = RegSetValue&(lphKey&, "shell\open\command", REG_SZ, _
    > sKeyValue, MAX_PATH)
    > ' icon
    > sKeyValue = App.Path & "\Ani\CIMDFile.ICO"
    > ret& = RegSetValue&(lphKey&, "DefaultIcon", REG_SZ, _
    > sKeyValue, MAX_PATH)




  3. #3
    Dean Earley Guest

    Re: DefaultIcon in a file asociated with my program

    You have created a string value called DefaultIcon. You need to create a Key and set the default string value

    --
    Dean Earley (dean.earley@icode.co.uk)
    Assistant Developer

    iCode Systems
    "MaRiØ" <mgonzalez@grupocimd.com> wrote in message news:3bcfdd97$1@news.devx.com...
    >
    > I´ve created a file association to my app, when I click the file, my
    > app launchs OK.But the file don´t show the ICON that I push in Registry
    > What´s the problem??
    >
    > sKeyName = "CIMDFile"
    > sKeyValue = "bla bla bla"
    > ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
    > ret& = RegSetValue&(lphKey&, "", REG_SZ, sKeyValue, 0&)
    > ' fILE extension sKeyName = ".cim"
    > sKeyValue = "CIMDFile"
    > ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
    > ret& = RegSetValue&(lphKey&, "", REG_SZ, sKeyValue, 0&)
    > ' executable path
    > sKeyName = "CIMDFile"
    > sKeyValue = App.Path & "\" & "CIMDApp.EXE ""%1""" 'parametters
    > ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
    > ret& = RegSetValue&(lphKey&, "shell\open\command", REG_SZ, _
    > sKeyValue, MAX_PATH)
    > ' icon
    > sKeyValue = App.Path & "\Ani\CIMDFile.ICO"
    > ret& = RegSetValue&(lphKey&, "DefaultIcon", REG_SZ, _
    > sKeyValue, MAX_PATH)




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links