1
Vote

IconOverlay - CanShowOverlay return with true, but icon don't visible

description

Hello!

I have some problem with IconOverlay shell extension.

I don't know, why is my icon not showing up.

My CanShowOverlay is:
        protected override bool CanShowOverlay(string path, FILE_ATTRIBUTE attributes)
        {
            try
            {
                
                var fileAttributes = new FileInfo(path);

                var reg = Registry.GetValue(keyName,
                      "Program_Installation_Directory",
                      "NoValue");

                string appPath = reg != null ? reg.ToString() : "";
                if (appPath != "NoValue")
                {
                    bool connected = false;
                    try
                    {
                        dc = new SqLiteIface(appPath);
                        connected = true;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Error(db): " + ex.Message);
                    }


                    if (connected)
                    {
                        if (dc.GetChangedFilesString().Contains(path))
                        {
                            MessageBox.Show(path + " SHOW");
                            return true;
                        }
                        else return false;
                    }
                    else return false;

                }
                else return false;

            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message);
                return false;
            }
        }
As you see, i put (only for debug) some messagebox.show command into the void, and I got the message from MessageBox.Show(path + " SHOW");, but somehow the icon is not showing in explorer.

I register the dll with servermanager and I restart the explorer after it.

My GetOverlayIcon is only this:
 protected override Icon GetOverlayIcon()
        {
            return Properties.Resources.StatusShellIconsStatusChanged;
        }
Priority is 90 atm, but I tried with 10,0 etc:
protected override int GetPriority()
        {
            return 90;
        }
StatusShellIconsStatusChanged is an ico file in 16x16 pixel.

Operating system: windows 7 64 bit.

comments

stylerhun wrote Feb 2, 2015 at 10:31 AM

It's working now. I had to rename my extension to be the first in the alphabet in registry...

stylerhun wrote Feb 2, 2015 at 10:32 AM

It's working now. I had to rename my extension to be the first in the alphabet in registry...