Hi,
i am working on creating bandobject in dot net. i have created band object
sucessfully. but to show that band object in taskbar i have to right click &
then click on tollbar, then i have to select my bandobject. But my
requirement is to show band object automatically, without right click on
taskbar. i am taking help from
http://www.codeproject.com/KB/shell/...select=2138288
also i am using below code in band object. But i am unable to show this
bandobject programmically. Can anybody help me out to solve this problem.
because below register function is a static function & called shen band
object is registered and other functions are non static, which cannot call in
register. Pleasse help me to solve this problem.
[ComRegisterFunctionAttribute]
public static void Register(Type t)
{
string guid = t.GUID.ToString("B");
RegistryKey rkClass =
Registry.ClassesRoot.CreateSubKey(@"CLSID\"+guid );
RegistryKey rkCat = rkClass.CreateSubKey("Implemented
Categories");
BandObjectAttribute[] boa =
(BandObjectAttribute[])t.GetCustomAttributes(
typeof(BandObjectAttribute),
false );
string name = t.Name;
string help = t.Name;
BandObjectStyle style = 0;
if( boa.Length == 1 )
{
if( boa[0].Name != null )
name = boa[0].Name;
if( boa[0].HelpText != null )
help = boa[0].HelpText;
style = boa[0].Style;
}
rkClass.SetValue(null, name );
rkClass.SetValue("MenuText", name );
rkClass.SetValue("HelpText", help );
if( 0 != (style & BandObjectStyle.Vertical) )
rkCat.CreateSubKey("{00021493-0000-0000-C000-000000000046}");
if( 0 != (style & BandObjectStyle.Horizontal) )
rkCat.CreateSubKey("{00021494-0000-0000-C000-000000000046}");
if( 0 != (style & BandObjectStyle.TaskbarToolBar) )
rkCat.CreateSubKey("{00021492-0000-0000-C000-000000000046}");
if( 0 != (style & BandObjectStyle.ExplorerToolbar) )
Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Micr osoft\Internet
Explorer\Toolbar").SetValue(guid,name);
}