| | |
Open folder by clicking a command button from VB GUI
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2008
Posts: 8
Reputation:
Solved Threads: 0
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,
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,
you must to declare what is SW_SHOWNORMAL.
vb Syntax (Toggle Plain Text)
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 Private Const SW_HIDE = 0 Private Const SW_MAXIMIZE = 3 Private Const SW_MINIMIZE = 6 Private Const SW_RESTORE = 9 Private Const SW_SHOW = 5 Private Const SW_SHOWDEFAULT = 10 Private Const SW_SHOWMAXIMIZED = 3 Private Const SW_SHOWMINIMIZED = 2 Private Const SW_SHOWMINNOACTIVE = 7 Private Const SW_SHOWNA = 8 Private Const SW_SHOWNOACTIVATE = 4 Private Const SW_SHOWNORMAL = 1 Private Const ERROR_FILE_NOT_FOUND = 2& Private Const ERROR_PATH_NOT_FOUND = 3& Private Const ERROR_BAD_FORMAT = 11& Private Const SE_ERR_ACCESSDENIED = 5 ' access denied Private Const SE_ERR_ASSOCINCOMPLETE = 27 Private Const SE_ERR_DDEBUSY = 30 Private Const SE_ERR_DDEFAIL = 29 Private Const SE_ERR_DDETIMEOUT = 28 Private Const SE_ERR_DLLNOTFOUND = 32 Private Const SE_ERR_NOASSOC = 31 Private Const SE_ERR_OOM = 8 ' out of memory Private Const SE_ERR_SHARE = 26 Private Const STYLE_NORMAL = 11
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
thx. i m glad to hear that
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Similar Threads
- Apache (Linux Servers and Apache)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: vb6 help/chm doesn't work under VISTA(r)
- Next Thread: Creating/copying data between notepad files
Views: 2387 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






