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.
[ComRegisterFunc tionAttribute]
public static void Register(Type t)
{
string guid = t.GUID.ToString ("B");
RegistryKey rkClass =
Registry.Classe sRoot.CreateSub Key(@"CLSID\"+g uid );
RegistryKey rkCat = rkClass.CreateS ubKey("Implemen ted
Categories");
BandObjectAttri bute[] boa =
(BandObjectAttr ibute[])t.GetCustomAtt ributes(
typeof(BandObje ctAttribute),
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.SetValu e(null, name );
rkClass.SetValu e("MenuText", name );
rkClass.SetValu e("HelpText", help );
if( 0 != (style & BandObjectStyle .Vertical) )
rkCat.CreateSub Key("{00021493-0000-0000-C000-000000000046}") ;
if( 0 != (style & BandObjectStyle .Horizontal) )
rkCat.CreateSub Key("{00021494-0000-0000-C000-000000000046}") ;
if( 0 != (style & BandObjectStyle .TaskbarToolBar ) )
rkCat.CreateSub Key("{00021492-0000-0000-C000-000000000046}") ;
if( 0 != (style & BandObjectStyle .ExplorerToolba r) )
Registry.LocalM achine.CreateSu bKey(@"SOFTWARE \Microsoft\Inte rnet
Explorer\Toolba r").SetValue(gu id,name);
}