Results 1 to 16 of 16

Thread: Simple Common Dialog Question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    Exclamation Simple Common Dialog Question

    How do you make the common dialog initdir default to my computer? Thank you for the help.

    Joe

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    could u run that one by me one more time... sloooowley please
    -= a peet post =-

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    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

  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    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...)
    -= a peet post =-

  5. #5
    Methinks it is some crazy-a** registry key, like "{a2a9545d-a0c2-42b4-9708-a0b2badd77c8}" but some other permutation of hex numbers.

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    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.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    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

  8. #8
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    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 ?
    -= a peet post =-

  9. #9
    Frenzied Member Motoxpro's Avatar
    Join Date
    Sep 2001
    Location
    Spiro, OK
    Posts
    1,211
    i would go for the DriveListBox like Hack said

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    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

  11. #11
    Frenzied Member Motoxpro's Avatar
    Join Date
    Sep 2001
    Location
    Spiro, OK
    Posts
    1,211
    i have 1 more sugestin...you could setup a form like a common dialog

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    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

  13. #13
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    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:
    1. Private Sub Command1_Click()
    2. With CommonDialog1
    3.    .CancelError = True
    4.    .InitDir = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
    5.    .DialogTitle = "My Computer"
    6.    .ShowOpen
    7. End With
    8. 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:
    1. Private Sub Command1_Click()
    2. With CommonDialog1
    3.    .CancelError = True
    4.    .InitDir = "::{208D2C60-3AEA-1069-A2D7-08002B30309D}"
    5.    .DialogTitle = "Starting In Network Neighborhood"
    6.    .ShowOpen
    7. End With
    8. End Sub

  14. #14
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629

    Thumbs up

    Damn good post Hack !!

    best piece of detective work I ever saw on this site... thanks for sharing
    -= a peet post =-

  15. #15
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    I know this is going to sound way, way geeky peet, but it was fun!!

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    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
  •  



Click Here to Expand Forum to Full Width