|
-
Nov 20th, 2001, 11:20 AM
#1
Thread Starter
Hyperactive Member
Simple Common Dialog Question
How do you make the common dialog initdir default to my computer? Thank you for the help.
Joe
-
Nov 20th, 2001, 12:20 PM
#2
-= B u g S l a y e r =-
could u run that one by me one more time... sloooowley please
-
Nov 20th, 2001, 01:32 PM
#3
Thread Starter
Hyperactive Member
To clarify
I have a common dialog control. I need it to make the default directory(the initdir) to My Computer so that they see all the drives and such. How would I do this? Thank you for the help.
Joe
-
Nov 20th, 2001, 01:42 PM
#4
-= B u g S l a y e r =-
oh, yes, see what u mean... that is a good question Joey_k29.
not sure its possible though.... I'v never seen "My Computer" beeing the init dir of a common dialog in any program... have u ?
Also I tried using the Browse for Folder thingy built into Windows, and when selecting the "My Computer" u are not allowed to select ok. (Thought I might find what to set the init dir to that way...)
-
Nov 20th, 2001, 01:44 PM
#5
Member
Methinks it is some crazy-a** registry key, like "{a2a9545d-a0c2-42b4-9708-a0b2badd77c8}" but some other permutation of hex numbers.
-
Nov 20th, 2001, 01:51 PM
#6
As an alternative to the Common Dialog, what about using the 3 Amigo controls: DriveListBox, FileListBox and DirListBox? Your users would be able to see all mapped drives very easily.
-
Nov 20th, 2001, 01:56 PM
#7
Thread Starter
Hyperactive Member
Eh....
I tried returning the systempath using API calls, but it did not like that at all. I guess it was not as simple a question as I thought :P I was looking for a quick fix, but it does not appear like there is one. Thank you for the help.
Joe
-
Nov 20th, 2001, 02:04 PM
#8
-= B u g S l a y e r =-
hmm... sorry I could not help u solve this... we just have to keep our eyes open ... might stumble onto some solution... If u do let us know ?
-
Nov 20th, 2001, 02:11 PM
#9
Frenzied Member
i would go for the DriveListBox like Hack said
-
Nov 20th, 2001, 02:27 PM
#10
Thread Starter
Hyperactive Member
Thank you but...
The simplicity and advantages(visually as well as for ease of programming) are more appropriate for this situation. Thank you for your help. If no one knows to do it through common dialog, I may simply have to place my default elsewhere. Thank you for the help and suggestions once again.
Joe
-
Nov 20th, 2001, 02:36 PM
#11
Frenzied Member
i have 1 more sugestin...you could setup a form like a common dialog
-
Nov 20th, 2001, 02:56 PM
#12
Thread Starter
Hyperactive Member
Well...
The main advantage of the common dialog is the ability to limit the files that can be selected to only one type(hence the need for no error checking). This advantage is well worth directing the default directory elsewhere. Hmm, but how about this? What if I put the default directory to C: and sent a backspace immediately as it was called?? Is there something more graceful similar to this that could work? Thanks for the help.
Joe
-
Nov 21st, 2001, 07:08 AM
#13
Found It!
The comment that filburt1 made about this being some kind of registry key triggered something in my rapidly deteriorating memory. I took out a subscription to the Visual Basic Programmers Journal back in 1994, and have every issue of the magazine since then stored in boxes and binders. I remembered seeing something about using the Common Dialog to fire up My Computer, and after 2 hours of searching last night I found it, in a Q & A section of a 1998 issue (I already forgot which month). Here it is. Thanks to Karl Peterson for writing it and thanks to my wife for allowing me to keep almost 8 years worth of old magazines in "her" basement.
VB Code:
Private Sub Command1_Click()
With CommonDialog1
.CancelError = True
.InitDir = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
.DialogTitle = "My Computer"
.ShowOpen
End With
End Sub
(Spoken in the tone of voice of a TV game show host) And as a special added bonus for appearing in our thread today, you will also receive - Network Neighborhood
VB Code:
Private Sub Command1_Click()
With CommonDialog1
.CancelError = True
.InitDir = "::{208D2C60-3AEA-1069-A2D7-08002B30309D}"
.DialogTitle = "Starting In Network Neighborhood"
.ShowOpen
End With
End Sub
-
Nov 21st, 2001, 07:27 AM
#14
-= B u g S l a y e r =-
-
Nov 21st, 2001, 07:37 AM
#15
I know this is going to sound way, way geeky peet, but it was fun!!
-
Nov 21st, 2001, 10:38 AM
#16
Thread Starter
Hyperactive Member
Thank you very much...
You are a nut. Haha, but thank you for all the help. This will be particularly useful. Thanks again.
Joe
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
|