Active Directory Tree Icons

K

Kevin M. Saucier

Hello,

I am posting this message for one of our developers so it may not
sound quite right, but I think people will get the idea.

He has written an application that brings up a treeview and shows the
Active Directory tree from the root down. The problem is that we are
unable to find the Active Directory icons to make the tree have the
familiar interface that all Microsoft views have.

Question 1: Does anyone know where the icon files for users,
organizational units, domains, etc. are located?

Question 2: Is there something that can be referenced in the code
that will automatically put the correct icon there. This would be
prefered because then, when the icons change between versions of
Windows, the program would automatically change with it.

Thanks in advance,

Kevin M. Saucier
 
J

Jerry Ham

Some of them are in dsadmin.dll. Others are in there own dll files. You can
use Visual Studio to open "likely" DLL's and look at the icon and bitmap
resources (many of them are done as bitmaps with a mauve color applied for
transparency.)

However, if you wanted to load them "live" from the DLLs that they reside in
you need to reference them by number. That number is very likely to change
between Windows versions. So, what I have done with my apps is to just use
the AD admin tools and use paint brush and screen captures to cut out the
16x16 bitmaps and put my own transparency onto them.

Jerry
 
K

Kevin M. Saucier

Jerry,

Thanks for the help. I'm just posting back to save some other people
the time if they have the same question. I found all of the AD Icons
(sites, users, groups, ou's, servers, contacs, domains, etc.) in
%windir%\system32\dsuiext.dll .

Thanks again,

Kevin M. Saucier
 
M

Marc Scheuner [MVP ADSI]

Question 2: Is there something that can be referenced in the code
that will automatically put the correct icon there. This would be
prefered because then, when the icons change between versions of
Windows, the program would automatically change with it.

Well, basically, based on every DirectoryEntry's "SchemaClassName",
you need to pick an icon - the schema class name is a string such as
"user" or "container" - that's the only reliable way of telling the
object types apart.

So in the end, you'll have a statement similar to:

public int GetIconNumber(string aClassName)
{
int iIconNo = -1;

switch(aClassName.ToLower())
{
case "user": iIconNo = 1; break;
case "container": iIconNo = 2; break;
.......
}
return iIconNo;
}

or something along those lines.

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top