[Request] UserAccounts.CommonDialog |
Author: |
Message: |
Rene
Junior Member
Posts: 25
Joined: Jun 2006
|
O.P. [Request] UserAccounts.CommonDialog
Hi,
I know how to Select one File from you'r own PC,
But how can i select an Folder from you'r own PC ?
I can't find any way to do this with
new ActiveXObject('UserAccounts.CommonDialog')
I'm sorry, but i'm not an professional with ActiveXObjects
This post was edited on 07-04-2006 at 08:28 AM by Rene.
|
|
07-04-2006 08:27 AM |
|
|
Volv
Skinning Contest Winner
Posts: 1233 Reputation: 31
35 / /
Joined: Oct 2004
|
RE: [Request] UserAccounts.CommonDialog
quote: Originally posted by Eljay
code: var BrowseInfo = Interop.Allocate(32);
BrowseInfo.WriteDWORD(0, 0); //hOwner
BrowseInfo.WriteDWORD(4, 0); //pidlRoot
var foldertitle = Interop.Allocate((255+1) * 2);
BrowseInfo.WriteDWORD(8, foldertitle.DataPtr);
var sTitle = 'Test Window Title';
var pTitle = Interop.Allocate((sTitle.length+1) * 2);
pTitle.WriteString(0, sTitle, false);
BrowseInfo.WriteDWORD(12, pTitle.DataPtr);
BrowseInfo.WriteDWORD(16, 1); //ulFlags
BrowseInfo.WriteDWORD(20, 0); //lpfn
BrowseInfo.WriteDWORD(24, 0); //lparam
BrowseInfo.WriteDWORD(28, 0); //iImage
var pidl = Interop.Call('shell32', 'SHBrowseForFolder', BrowseInfo);
var folderpath = Interop.Allocate((255+1) * 2);
Interop.Call('shell32', 'SHGetPathFromIDList', pidl, folderpath);
Debug.Trace('Folder Path: ' + folderpath.ReadString(0, false));
Debug.Trace('Folder Title: ' + foldertitle.ReadString(0, false));
|
|
07-04-2006 02:18 PM |
|
|
Eljay
Elite Member
:O
Posts: 2949 Reputation: 77
– / / –
Joined: May 2004
|
RE: [Request] UserAccounts.CommonDialog
much simpler way i found not long after i first posted that, although it uses activex not windows api
code: var objShell = new ActiveXObject("Shell.Application");
var objFolder = objShell.BrowseForFolder(0, "Select a folder:", 0, "C:\\");
|
|
07-04-2006 02:25 PM |
|
|
Rene
Junior Member
Posts: 25
Joined: Jun 2006
|
O.P. RE: RE: [Request] UserAccounts.CommonDialog
quote: Originally posted by Eljay
much simpler way i found not long after i first posted that, although it uses activex not windows api
code: var objShell = new ActiveXObject("Shell.Application");
var objFolder = objShell.BrowseForFolder(0, "Select a folder:", 0, "C:\\");
And how i know what of Folder is selected ..?
|
|
07-04-2006 03:01 PM |
|
|
craig2k5
Junior Member
Posts: 64
Joined: Feb 2006
|
RE: RE: RE: [Request] UserAccounts.CommonDialog
quote: And how i know what of Folder is selected ..?
the part that says
quote: (0, "Select a folder:", 0, "C:\\");
maybe
|
|
07-04-2006 03:10 PM |
|
|
Rene
Junior Member
Posts: 25
Joined: Jun 2006
|
O.P. RE: RE: RE: RE: [Request] UserAccounts.CommonDialog
quote: Originally posted by craig2k5
quote: And how i know what of Folder is selected ..?
the part that says
quote: (0, "Select a folder:", 0, "C:\\");
maybe
When the user clicks on 'Ok' orso, then i must know what of director the user chose.
--
the one of Volv works fine
Thanx
This post was edited on 07-04-2006 at 03:25 PM by Rene.
|
|
07-04-2006 03:12 PM |
|
|
J-Thread
Full Member
Posts: 467 Reputation: 8
– / / –
Joined: Jul 2004
|
RE: [Request] UserAccounts.CommonDialog
People should learn to use MSDN
|
|
07-04-2006 04:21 PM |
|
|
Rene
Junior Member
Posts: 25
Joined: Jun 2006
|
O.P. RE: RE: [Request] UserAccounts.CommonDialog
quote: Originally posted by J-Thread
People should learn to use MSDN
I'm dutch my friend
And not the best in English.
|
|
07-04-2006 04:57 PM |
|
|
J-Thread
Full Member
Posts: 467 Reputation: 8
– / / –
Joined: Jul 2004
|
RE: [Request] UserAccounts.CommonDialog
I am Dutch too my friend, and it seems like you do know enough english to be able to understand the posts here. That implies you actually do have enough knowledge to be able to understand the MSDN too.
If you don't, you are IMHO not "good enough" to be a programmer.
|
|
07-04-2006 06:43 PM |
|
|
Rene
Junior Member
Posts: 25
Joined: Jun 2006
|
O.P. RE: RE: [Request] UserAccounts.CommonDialog
quote: Originally posted by J-Thread
I am Dutch too my friend, and it seems like you do know enough english to be able to understand the posts here. That implies you actually do have enough knowledge to be able to understand the MSDN too.
If you don't, you are IMHO not "good enough" to be a programmer.
Mm, not realy true, i'm programmer for 5 Years, so i can read a little bit english, but MSDN i don't know all of.
But i forget every time the MSDN orso, but i will add him on my bookmarks
And this discussion is not realy ontopic.
This post was edited on 07-04-2006 at 06:48 PM by Rene.
|
|
07-04-2006 06:48 PM |
|
|
|