 |
|
 |
I too had the problems with the tab stops not working and seeming to be in random order. I found that the tab order seems to be controlled by the order that the controls are added to the user control component. So, although it is not an ideal solution, I did find that I can get the tab order I need by changing the order that the controls are added in the InitializeComponent method of the user control.
|
|
|
|
 |
|
 |
Not quite sure how to implement this. Any help is appreciated.
|
|
|
|
 |
|
 |
Hi Hadi,
I can remove the dll dwWrapper.
For this, simply use the following definition in IShellPropSheetExt:
[PreserveSig()]
int AddPages([MarshalAs(UnmanagedType.FunctionPtr)] LPFNSVADDPROPSHEETPAGE pfnAddPage, IntPtr lParam);
Add this one in APIWrapper
[DllImport("comctl32.dll")]
private static extern IntPtr DestroyPropertySheetPage(IntPtr hProp);
then replace the call in AddApges by
int IShellPropSheetExt.AddPages(LPFNSVADDPROPSHEETPAGE pfnAddPage, IntPtr lParam)
[...]
hPage = APIWrapper.CreatePropertySheetPage(ref psp);
bool result = pfnAddPage(hPage, lParam);
if (!result)
{
APIWrapper.DestroyPropertySheetPage(hPage);
}
//APIWrapper.CallCallback(lpfnAddPage, hPage, lParam);
HTH
|
|
|
|
 |
|
|
 |
|
 |
I was not able to get this method using the PreserveSig attribute to work. When I changed the AddPages signature like you suggested I could not compile because it said that i did not implement the IShellPropSheetExt interface.
Regardless, thanks for the suggestion, it pointed me down the right path and I ended up doing this which worked for me:
LPFNSVADDPROPSHEETPAGE addPageCallback = (LPFNSVADDPROPSHEETPAGE)Marshal.GetDelegateForFunctionPointer(pfnAddPage, typeof(LPFNSVADDPROPSHEETPAGE));
and then calling the callback as you suggested:
bool result = addPageCallback (hPage, lParam);
Thanks to the original author too. This is very handy reference project.
-Seth
|
|
|
|
 |
|
 |
Hi,
The above code was really useful. it ran successfully on 32 bit windows XP & vista. But not displaying page on 64 bit XP.
Can you please help me in this.
Thanks & Regards,
Shree.
|
|
|
|
 |
|
 |
I need your help, i have tried the sample in three diferent systems, and only one got it to work and then it stopped working.
I m using your install.bat, and making sure it is registered regasm. I checked the registry and the entries are correct.
Do you have any suggestions?... does your still works?... perhaps a dll conflict.. thanks
|
|
|
|
 |
|
 |
Hello,
i try to set up the extension with the aim of displaying/modifying
some values of users/groups in the Active Directory (we wrote some
extensions with the same purpose under MFC ... which was really
cumbersome).
I might be fool ... but i can't find the point where i can access
the IDataObject in my derived class ... ? Could someone please give
me a hint ?
Thank you !!
|
|
|
|
 |
|
 |
Hello,
I have to build a property sheet which show some attributes. Your project is very well and a good basic for me. But my problem now is, how to "make the connection" between the property sheet and the Active Directoy. I don't know in which part of the project I must write the function, how the function access to the user and write out the attribute in a text field.
I'm very glad about every kind of help.
Greets
Manuel
|
|
|
|
 |
|
 |
Did you manage to figure this out, I am having the same problem. The examples on MSDN are a mess.
Thanks
|
|
|
|
 |
|
 |
How to find a name of a file?
|
|
|
|
 |
|
 |
public class APIWrapper
{
...
[DllImport("shell32.dll", SetLastError = true)]
public static extern int DragQueryFile(IntPtr hdrop, uint ifile, StringBuilder fname, uint fnsize);
...
----------
public class SheetLoader: IShellExtInit, IShellPropSheetExt
{
...
int IShellPropSheetExt.AddPages(IntPtr lpfnAddPage, IntPtr lParam)
{
...
string fname = GetFullName();
...
}
private string GetFullName()
{
try
{
FORMATETC fmt = new FORMATETC();
fmt.cfFormat = CLIPFORMAT.HDROP;
fmt.ptd = IntPtr.Zero;
fmt.dwAspect = DVASPECT.CONTENT;
fmt.lindex = -1;
fmt.tymed = TYMED.HGLOBAL;
STGMEDIUM medium = new STGMEDIUM();
dobj.GetData(ref fmt, ref medium); // returned HRESULT
IntPtr pClass = new IntPtr((uint)medium.hGlobal);
uint mz = 64000;
StringBuilder m_szFile = new StringBuilder();
m_szFile.Length = 64000;
int fCount = APIWrapper.DragQueryFile(pClass, 4294967295, null, 0);
int ff = APIWrapper.DragQueryFile(pClass, 0, m_szFile, mz);
return m_szFile.ToString();
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show("Error - " + ex.ToString());
return null;
}
}
|
|
|
|
 |
|
|
 |
|
 |
Hi,
I would like to be able to open for example the active directory user's property dialog(the default one from MMC) from my application without going throght MMC is there a way to do this ?.
|
|
|
|
 |
|
|
 |
|
 |
I understand the danger here for shell extensions but what about using this to add property pages to ADUC?
I would not think that the same issue would be a problem since the MMC is not managed so the risk of trying to load a new version of the framework into that process and having a conflict would be rather low.
|
|
|
|
 |
|
 |
How can I get the selected object? Your program will add one more property to the properties of EXE File(s).isn't it?
Suppose: I select one exe file called ABC.exe. then, I like to show the file name on the textbox.. How can I do that? Is there any way to get the selected file name?
Actually, I have made this property page to visible in Active Directory. But I dont know the way to get some infomations of the selected object (User).
Thanks.
Regards,
Michael Sync
http://michaelsync.wordpress.com/
|
|
|
|
 |
|
 |
Thanks.
I got one issue. It's not working in Windows 2003.
Regards,
Michael Sync
http://michaelsync.wordpress.com/
|
|
|
|
 |
|
 |
Oh. Yeah. It works after rebuilding it on Windows 2003.
|
|
|
|
 |
|
 |
Dear fellow programmers,
Thanks for all your questions and comments. There are a few points I would like to make:
1- This project is not about registering a .NET COM, or writing an explorer shell extension or active directory interface update. There is lots of information and samples about all of these in MSDN.
2- This project is about writing the COM property sheet only, in C#, as this has no sample in MSDN and appears impossible to do.
I am sorry that I am not able to help you more. If anybody cares to complete the project I could put a link here.
|
|
|
|
 |
|
 |
Hi, Do you have any code that would register the extened property sheet I created for the "Computers" (container)? I looked at your install.bat and tried to modified it but I don't know how to get the nodetypeGuid for this registeration. I'm using V.S 2005 C# and MMC 2.0 (I have to have this product running in windows 2000 server, hence the restriction to support the MMC 2.0). Appreciate it if anyone can help with this. Thanks.
Alpha
Alpha
|
|
|
|
 |
|
 |
I am having difficulty with using your code and adding a page to the Active Directory Users Properties. Do you have some sample code that will register the dll with the MMC for Active Directory Users?
Regards,
Joe
|
|
|
|
 |
|
 |
It can be done by using ADSIEdit.msc.
All you need to do is that
1. run install.bat. and
2. Add this CLSID in adminPropertyPages of Display Specifier.
Regards,
Michael Sync
|
|
|
|
 |
|
 |
Hi
I'm looking at using something like this for an actual property on a folder. So i've got 2 questions really;
How do I apply this to folders instead of .exe's
How do I get the path of the folder (or name of the file)
Cheers
Mat
|
|
|
|
 |
|
 |
This would be really useful. Instead of having just a bunch of buttons and boxes on the sample page this should have some actual information on the file. Even if it was a dupe of the existing properties it would be ok.
|
|
|
|
 |