Open folder by clicking a command button from VB GUI

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Mar 2008
Posts: 8
Reputation: Asad__ is an unknown quantity at this point 
Solved Threads: 0
Asad__ Asad__ is offline Offline
Newbie Poster

Open folder by clicking a command button from VB GUI

 
0
  #1
Mar 11th, 2008
hi, am brand new to VB. i have the same problem. i want to open a folder, say; C:\apache on clicking a command button on VB GUI. i have something like this:

Private Sub Command1_Click()
ShellExecute hWnd, "open", "C:\apache", _
vbNullString, vbNullString, SW_SHOWNORMAL
End Sub
but it gives compilation error. "Sub or Function not defined"
can somebody help me out.
Regards,
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Open folder by clicking a command button from VB GUI

 
3
  #2
Mar 11th, 2008
you must to declare what is SW_SHOWNORMAL.
  1. Private 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
  2. Private Const SW_HIDE = 0
  3. Private Const SW_MAXIMIZE = 3
  4. Private Const SW_MINIMIZE = 6
  5. Private Const SW_RESTORE = 9
  6. Private Const SW_SHOW = 5
  7. Private Const SW_SHOWDEFAULT = 10
  8. Private Const SW_SHOWMAXIMIZED = 3
  9. Private Const SW_SHOWMINIMIZED = 2
  10. Private Const SW_SHOWMINNOACTIVE = 7
  11. Private Const SW_SHOWNA = 8
  12. Private Const SW_SHOWNOACTIVATE = 4
  13. Private Const SW_SHOWNORMAL = 1
  14.  
  15. Private Const ERROR_FILE_NOT_FOUND = 2&
  16. Private Const ERROR_PATH_NOT_FOUND = 3&
  17. Private Const ERROR_BAD_FORMAT = 11&
  18. Private Const SE_ERR_ACCESSDENIED = 5 ' access denied
  19. Private Const SE_ERR_ASSOCINCOMPLETE = 27
  20. Private Const SE_ERR_DDEBUSY = 30
  21. Private Const SE_ERR_DDEFAIL = 29
  22. Private Const SE_ERR_DDETIMEOUT = 28
  23. Private Const SE_ERR_DLLNOTFOUND = 32
  24. Private Const SE_ERR_NOASSOC = 31
  25. Private Const SE_ERR_OOM = 8 ' out of memory
  26. Private Const SE_ERR_SHARE = 26
  27.  
  28. Private Const STYLE_NORMAL = 11
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 97
Reputation: Estella is an unknown quantity at this point 
Solved Threads: 6
Estella's Avatar
Estella Estella is offline Offline
Junior Poster in Training

Re: Open folder by clicking a command button from VB GUI

 
0
  #3
Mar 11th, 2008
hi..i get some problem too, and thanks for the declaration.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Open folder by clicking a command button from VB GUI

 
0
  #4
Mar 11th, 2008
thx. i m glad to hear that
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
  • Apache (Linux Servers and Apache)

Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 2387 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC