EldoS | Feel safer!

Software components for data protection, secure storage and transfer

CallbackFileSystem.InstallIcon method

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#27676
Posted: 12/16/2013 08:05:11
by pnina (Standard support level)
Joined: 11/20/2013
Posts: 36

I want to set my own icon for a network drive using the VDisk sample for C# by doing this:

Code
CallbackFileSystem.Initialize(mGuid);

bool reboot = false;
CallbackFileSystem.InstallIcon(@"C:\...\1.ico", "myIcon", ref reboot);

mCbFs.CreateStorage();

mCbFs.SetIcon("myIcon");

btnMount.Enabled = true;
btnDeleteStorage.Enabled = true;
btnAddPoint.Enabled = true;


But I get an error on this line: CallbackFileSystem.InstallIcon(@"C:\...\1.ico", "myIcon", ref reboot);
saying:
"The specified module could not be found"
#27677
Posted: 12/16/2013 08:06:37
by Eugene Mayevski (EldoS Corp.)

Have you included MntNtf DLL into the list of the installed module in your call to Install() method? That DLL also manages icons.


Sincerely yours
Eugene Mayevski
#27687
Posted: 12/17/2013 00:43:15
by pnina (Standard support level)
Joined: 11/20/2013
Posts: 36

I did now. No errors now, but no icon as well.
This is my install:
Code
CallbackFileSystem.Install( dlgOpenDrv.FileName,
mGuid,      
System.Environment.SystemDirectory,
true,
CallbackFileSystem.CBFS_MODULE_MOUNT_NOTIFIER_DLL|                                           CallbackFileSystem.CBFS_MODULE_NET_REDIRECTOR_DLL,
ref Reboot );

And the code that was written in the previous message.
Also, here: CallbackFileSystem.InstallIcon(@"C:\...\1.ico", "myIcon", ref reboot);
the reboot always return "true", even after a restart
#27690
Posted: 12/17/2013 02:38:25
by Vladimir Cherniga (EldoS Corp.)

Quote
Also, here: CallbackFileSystem.InstallIcon(@"C:\...\1.ico", "myIcon", ref reboot);
the reboot always return "true", even after a restart

Reboot always set true on success. At least it does require "explorer.exe" process to be restarted. Then you can set icon with CallbackFileSystem.SetIcon() api. Refresh explorer window with F5, if disk icon not changed. There are two possibility when icon not visible: 1) invalid icon format, 2) your temp folder was cleared on system restart after CallbackFileSystem.InstallIcon() call. It could be checked by testing an icon temp path written in registry settings for installed icon (use ProcMon tool to monitor registry changes). The temporary file should survive on first system restart. On the next restart it could be deleted safely.

Reply

Statistics

Topic viewed 1242 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!