Results 1 to 9 of 9

Thread: Open a folder

  1. #1
    Guest

    Lightbulb

    I know this may be an easy command but I can't seem to find it..
    I want when a user clicks a button it opens to a folder on the hard drive(specified in the program)

    thanks!

  2. #2
    Lively Member
    Join Date
    Aug 2000
    Posts
    125
    see help and examples on

    Open
    Input
    Close

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Wink by shelling explorer


    Code:
    shell "explorer " & Text1.text, vbNormalFocus
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4
    Guest
    You could also use the ShellExecute api function to open a folder.

    Code:
    Declare Function ShellExecute Lib "shell32.dll" _
     Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
    lpOperation As String, ByVal lpFile As String, ByVal _
    lpParameters As String, ByVal lpDirectory As String, ByVal _
    nShowCmd As Long) As Long
    
    Public Const SW_SHOWNORMAL = 1
    
    
    Usage
    
    ShellExecute Me.hwnd, vbNullString, "C:\MyFolder", _
     vbNullString, "c:\", SW_SHOWNORMAL

  5. #5
    Guest
    IT's much easier just to use VB's Shell method rather than API.

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Correct
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7
    Guest
    Let's see. How shall I defend myself?

    1. It may be easier, but the API function is more efficient?

    2. I am always right?

    3. I have no more excuses?

    [/quote]

    And then you have:

    1. kedaman and Megatron may be absolutely right, it is much easier?

    2. The dog ate it?

    3. You have 1 & 2, isn't that good enough?


    my 0.03¢

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Hehe, technically i mean philosophically:

    1. If you use shellexecute, it will open registry and get the default command line and then do 2.

    2. If you use shell, then it will just run the command line (execute the app with it's parameters)

    3. Or maybe it's so that shell is running shellexecute? No can't be, hehe but it's indeed in the runtimes anyway.

    4. Yep Shell easiest to spell, S H E L L. no need to type E X E C U T E. + You don't need to declare anything.

    5. Both does the same thing, do you see any difference?

    6. I'm always right, i know all the vb answers but what was the qwestion?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  9. #9
    Guest
    A Guru with a sense of humor! Hallejuia!
    I learned something new!: A Guru with a sense of humor!

    That's one less person in the World that I have to worry about teaching to have a sense of humor.

    Thanks kedaman, you made my night .

    By the way, I'm always right!
    I may not always give the answer needed, but I am not wrong, just confused a little .

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