-
October 27th, 2006, 01:50 AM
#1
how to show the "share folder" Dlg
Hi all,
there is a function called "ShowShareFolderUIW" in ntshrui.dll, that shows a folders property page with the sharing options of that folder. But this function is not there on Win2k, only on XP.
Does anybody know, how to achive this on Win2k (or even better: on all Win32 platforms)?
regards
HoM
-
October 27th, 2006, 05:16 AM
#2
Re: how to show the "share folder" Dlg
Regards,
Ramkrishna Pawar
-
October 27th, 2006, 05:19 AM
#3
Re: how to show the "share folder" Dlg
Also IShellFolder interface can be used to get the Context menu interface, and then you can use IContextmenu::ExecuteCommand to invoke folder properties.
http://msdn.microsoft.com/library/de...older_info.asp
Regards,
Ramkrishna Pawar
-
October 27th, 2006, 05:27 AM
#4
Re: how to show the "share folder" Dlg
thanks a lot.
Actually we achieved showing the "properties" by doing a shellexecute on the folder with the verb "properties". But ... we would be much more happy, if the "sharing" page would be open, not the properties.
regards
HoM
-
October 27th, 2006, 05:43 AM
#5
Re: how to show the "share folder" Dlg
I think the SHObjectProperties can do that, see the last argument szPage, there you can specify which page to open initially.
Regards,
Ramkrishna Pawar
-
October 27th, 2006, 09:15 AM
#6
Re: how to show the "share folder" Dlg
Thanks a lot. One can really get the dialog with this API.
The sad part of it: It is one of the most stupid APIs I have ever seen, because one must spezify the text, that is on the tab of the page to be opened (in my case: "sharing" or - in german - "freigabe").
Of course this is different on each language version of windows, so - acutally the function is more or less useless, if you want it to work with all languages. :-(
If there are other ideas outside, that overcome the language problem, please let me know.
regards
HoM
-
October 30th, 2006, 04:36 AM
#7
Resolved(?): how to show the "share folder" Dlg
Finally: Maybe there is a way to do it right for all languages:
Open the file ntshrui.dll as a resource and read the String resource with the ID 103 and take that as input for the API ShObjectProperties. On english systems ist "sharing", on german systems it is "freigabe" so hopefully it works on other languages, too (maybe some of you can test and write here?).
regards
HoM
-
October 30th, 2006, 06:57 AM
#8
Re: how to show the "share folder" Dlg
For sake of completness: This is sample code how to get the string, that you need for the call to SHObjectProperties :
Code:
CComBSTR bstrNtShrUiDll;
// read the path to Systen32 folder and copy it to bstrNtShrUiDll
...
bstrNtShrUiDll.Append( L"\\ntshrui.dll" );
HMODULE hDLL = ::GetModuleHandleW( bstrNtShrUiDll );
WCHAR wszBuffer[MAX_PATH] = {0};
::LoadStringW( hDLL, 103, wszBuffer, MAX_PATH ); // The string resource 103 stands for the "Sharing" (or "Freigabe" in German)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|