Click to See Complete Forum and Search --> : few simple questions
casparas
Dec 28th, 1999, 09:44 PM
ok ok i'm not a pro so my questions are simple
1. how to execute program then the command button is clicked?
for egzample if i have program 1.exe
on C:\path\
How to execute it with my vb program?
2. how to open folder then the button is clicked?
3. Why is all this programing so hard to learn?
russb
Dec 28th, 1999, 10:32 PM
1.
Private Sub Command1_Click()
Shell ("C:\Path\1.exe")
End Sub
2.
Dunno
3.
Cos it is
Russ
1. The other dude was right
2. There is most likely a API call for it but to make things easy just do
Shell "IEXPLORE <YOURPATH>"
with out the <YOURPATH>
3. It isn't, it is just a matter of finding a good source site! I recommend this one It takes a while to find what you want but you will find it eventually!
Hope I helped out!
ALF
ALFWare
Serge
Dec 29th, 1999, 04:31 AM
For your second question you can try something like this (Add a command button - Command1):
Private Type BROWSEINFO 'bi
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Private Const BIF_RETURNONLYFSDIRS = &H1
Public Function ShowFolderDialog(pHwnd As Long) As String
Dim biStruct As BROWSEINFO
Dim lPidl As Long
Dim lRet As Long
Dim intPos As Integer
Dim strPath As String
biStruct.hOwner = pHwnd
biStruct.pidlRoot = 0
biStruct.lpszTitle = "Select Folder"
biStruct.ulFlags = BIF_RETURNONLYFSDIRS
lPidl = SHBrowseForFolder(biStruct)
strPath = Space(512)
lRet = SHGetPathFromIDList(ByVal lPidl, ByVal strPath)
If lRet Then
intPos = InStr(strPath, vbNullChar)
ShowFolderDialog = Left(strPath, intPos - 1)
End If
End Function
Private Sub Command1_Click()
MsgBox ShowFolderDialog(Me.hWnd)
End Sub
------------------
Serge
Software Developer
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)
casparas
Dec 29th, 1999, 11:27 AM
Thanx
-Casparas
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.