Results 1 to 5 of 5

Thread: few simple questions

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 1999
    Location
    Vilnius, Lithuania
    Posts
    50

    Post

    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?

  2. #2
    New Member
    Join Date
    Dec 1999
    Posts
    1

    Post

    1.
    Private Sub Command1_Click()
    Shell ("C:\Path\1.exe")
    End Sub

    2.
    Dunno

    3.
    Cos it is

    Russ

  3. #3
    Guest

    Post

    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

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    For your second question you can try something like this (Add a command button - Command1):
    Code:
    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
    [email protected]
    ICQ#: 51055819


  5. #5

    Thread Starter
    Member
    Join Date
    Dec 1999
    Location
    Vilnius, Lithuania
    Posts
    50

    Post

    Thanx

    -Casparas

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