Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    GreenPro's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    My Mood
    Innocent

    Question Making A Program To Open Another Program - Need Help !

    Hello , i am a newbie in visual basic ( and also other programming languages ) and i need help ! I am trying to make a program that can add programs to a "ListView" with open file dialog and then the user selects any program from the list and hits a button and the program automatically launches and if the program failed it would use the error provider to give an error telling the user "The program has been moved , changed or deleted ! If the program is still in your machine then please add it to the list again!" , also the user can change the settings by clicking the settings button and maybe refresh the listview and maybe like a checkbox "Close This Program After Launching A Application" plus there would be a button to remove selected application from the listview . . . Please Help ! ( Codes , And A Bit Explaining Helps Please :P )

    Here Is What Is Added to The Form . . .
    A RichTextBox(Read Only , just for the place to add title and with background color to make the program look good lol . . i love designing ! )
    Information Button (dont worry about this)
    Exit Application (dont worry about this either)
    Settings (btn_settings , opens another form , no need to worry about this !)
    Settings Form [Refresh(btn_refresh , to refresh listview) checkbox(checkbox1 , Close this program after launching a application {only if checked}) ]
    Remove Button (btn_remove , remove selected application in listview)
    Add Button (btn_add , add a application with open file dialog , into the listview)
    Launch Selected (btn_launch , launch the application selected/highlighted from the listview)!
    ListView (ListView1 , where the applications added using openfiledialog will be and can be removed from here)

    The Applications That Will Be Added Will Be Shortcuts Mainly Actually . . .
    Only Exe Files . . .

    Also , Heres A ScreenShot Of The Interface of the program i am trying to make :
    Attached Thumbnails Attached Thumbnails
    screenshot_1.png  

    Last edited by GreenPro; 04-24-2013 at 08:04 AM. Reason: wrong refrence for button

  2. #2
    ARGB's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    68
    Reputation
    10
    Thanks
    9
    My Mood
    Dead
    .. use OpenFileDialog and then shell(OpenFileDialog.FileName)
    do the rest yourself .. and learn programming before okay?

  3. #3
    GreenPro's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    My Mood
    Innocent
    I didn't really ask you to just go ahead and write the whole coding , cant you just give me a good link ? You know that 2 pieces of line are useless , you just said to use openfiledialog . . . thats it . . . thats not even close to helping . . . its a help request . . thats just rude , if you dont want to answer correctly then please dont ! :/ . . . just explain some coding or just give me a good link ok . . . i have tried to find links but all links that i found mostly just tell you how to do it , they dont explain codings to you , thats why i decided to post this topic here . . sorry if you thought this was rude . . .
    Last edited by GreenPro; 04-24-2013 at 08:52 AM. Reason: missed a few words

  4. #4
    ARGB's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    68
    Reputation
    10
    Thanks
    9
    My Mood
    Dead
    lolz .. I gave you the hint to use OpenFileDialog and the other shit with shell. If you dont know anything you srsly shouldnt try to code.
    and have you ever heart of google?
    google.com

  5. #5
    GreenPro's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    My Mood
    Innocent
    dude you gave me a useless hint . . . i do know i need to use openfiledialog and did use google and i do know what shell is and im trying to code here but kinda failing a bit so thats why just for good guides i posted the topic here . . . please dont give silly answers :/ ! but thanx anyway ^_^ for trying to help .

  6. #6
    SwissBio's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Location
    @:root/swissbio.exe
    Posts
    100
    Reputation
    13
    Thanks
    148
    My Mood
    Blah
    Put a .exe program in a folder with your primary program and type in code at BUTTON1 :

    Code:
    Shell("program.exe")

    Why was this so hard ?
    Or.. you want another method.. PM ME.

  7. #7
    DawgiiStylz's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    Dawg House
    Posts
    7,811
    Reputation
    219
    Thanks
    2,896
    My Mood
    Tired
    You could use 1 of 2 ways. You could use the Shell() Function or the Process.Start() method. Either way, they both would work.
    In your case, I see that you're loading items into a list. If you want to open a selected file from that list, you'll need to have that item.tag or one of the columns to have the file path of that item. So, when you want to open that file, you can use one of the 2 methods to open the selected file.

    Reading the thread, you seem a bit slow on this topic.

    Code:
    'To open files to the list
    Dim dlg as New OpenFileDialog
    With dlg
    .MultiSelect = True
    .Restore Directory = True
    .Filter = "Executible Application(*.exe)|*.exe"
    .Title = "Open Files"
    End With
    
    If dlg.ShowDialog() = WindowsForms.DialogResult.Ok Then
    For each string in dlg.FileNames
    Dim item as new ListViewItem(else)
    item.SubItems.Add(System. IO.Path.GetFileNameWithoutExtension(ele))
    Listview1.Items.Add(item)
    Next
    
    'To start the selected file
    If My.Coputer.FileSystem.FileExist(Listview1.FocusedItem.Text) Then
    Shell(Listview1.FocusedItem.Text) 'Shell also have additional parameters if you want a few more options
    End If
    
    'form load event [Mybase.Load]
    ListView1.Columns.AddRange(New ColumnHeader() {New ColumnHeader("File Path"), New ColumnHeader("File Name")})
    Listview1.MultiSelect = False

    I did all this from the top of my head. Should be correct
    Last edited by DawgiiStylz; 04-24-2013 at 04:21 PM.

  8. The Following User Says Thank You to DawgiiStylz For This Useful Post:

    GreenPro (04-25-2013)

  9. #8
    Cryptonic's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    United Provinces of Canada
    Posts
    1,313
    Reputation
    44
    Thanks
    190
    My Mood
    Bored
    Quote Originally Posted by SwissBio View Post
    Put a .exe program in a folder with your primary program and type in code at BUTTON1 :

    Code:
    Shell("program.exe")

    Why was this so hard ?
    Or.. you want another method.. PM ME.
    I always use Process.Start
    (works with website links as well)

  10. #9
    King Aldrin's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    76
    Reputation
    10
    Thanks
    134
    My Mood
    Amazed
    Quote Originally Posted by GreenPro View Post
    Hello , i am a newbie in visual basic ( and also other programming languages ) and i need help ! I am trying to make a program that can add programs to a "ListView" with open file dialog and then the user selects any program from the list and hits a button and the program automatically launches and if the program failed it would use the error provider to give an error telling the user "The program has been moved , changed or deleted ! If the program is still in your machine then please add it to the list again!" , also the user can change the settings by clicking the settings button and maybe refresh the listview and maybe like a checkbox "Close This Program After Launching A Application" plus there would be a button to remove selected application from the listview . . . Please Help ! ( Codes , And A Bit Explaining Helps Please :P )

    Here Is What Is Added to The Form . . .
    A RichTextBox(Read Only , just for the place to add title and with background color to make the program look good lol . . i love designing ! )
    Information Button (dont worry about this)
    Exit Application (dont worry about this either)
    Settings (btn_settings , opens another form , no need to worry about this !)
    Settings Form [Refresh(btn_refresh , to refresh listview) checkbox(checkbox1 , Close this program after launching a application {only if checked}) ]
    Remove Button (btn_remove , remove selected application in listview)
    Add Button (btn_add , add a application with open file dialog , into the listview)
    Launch Selected (btn_launch , launch the application selected/highlighted from the listview)!
    ListView (ListView1 , where the applications added using openfiledialog will be and can be removed from here)

    The Applications That Will Be Added Will Be Shortcuts Mainly Actually . . .
    Only Exe Files . . .

    Also , Heres A ScreenShot Of The Interface of the program i am trying to make :
    Is this what you want? (download the attachment)

    Virus Scans:
    https://www.virustotal.com/en/file/b...is/1366866425/
    King.rar - Jotti's malware scan
    <b>Downloadable Files</b> Downloadable Files
    Last edited by Jorndel; 04-27-2013 at 04:04 PM.
    Imports MPGH.NET
    Public Class King_Aldrin

    Private Sub King_Aldrin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim thanks = mpgh.user.kingaldrin
    Dim help As Boolean
    If mpgh.user.other = Ask.question Then
    help = True
    Else
    help = False
    End If

    If help = True Then
    If mpgh.user.kingaldrin.answers > 0 Then
    MsgBox("Did I helped you? then press the Thanks button!", MsgBoxStyle.Information)
    Else
    MsgBox("I'm sorry! I think I can't answer your question")
    End If

    Else
    MsgBox("You didn't ask a question, Please ask a new question now by posting a new thread or PM'ing me!")
    End If
    End Sub
    End Class

  11. The Following User Says Thank You to King Aldrin For This Useful Post:

    GreenPro (04-25-2013)

  12. #10
    SwissBio's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Location
    @:root/swissbio.exe
    Posts
    100
    Reputation
    13
    Thanks
    148
    My Mood
    Blah
    Quote Originally Posted by PepsiXHacker View Post


    I always use Process.Start
    (works with website links as well)
    Yep ! I know. But for me is more simply to use that.

  13. #11
    GreenPro's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    My Mood
    Innocent
    Hello DawgiiStylz , your code had a few errors but the errors woulden't be that hard since now i know what i did wrong and how it works and some places its just mega easy lol . . .anyways but still here are the code errors i got in vb . . . and also thanx =) !!!

    Code:
    'To open files to the list
    Dim dlg as New OpenFileDialog
    With dlg
    .MultiSelect = True
    .RestoreDirectory = True
    .Filter = "Executible Application(*.exe)|*.exe"
    .Title = "Open Files"
    End With

    If dlg.ShowDialog() = WindowsForms.DialogResult.Ok Then
    For each string in dlg.FileNames
    Dim item as new ListViewItem(else)
    item.SubItems.Add(System. IO.Path.GetFileNameWithoutExtension(ele))
    Listview1.Items.Add(item)
    Next

    'To start the selected file
    If My.Computer.FileSystem.FileExist(Listview1.FocusedItem.Text) Then
    Shell(Listview1.FocusedItem.Text) 'Shell also have additional parameters if you want a few more options
    End If

    'form load event [Mybase.Load]
    ListView1.Columns.AddRange(New ColumnHeader() {New ColumnHeader("File Path"), New ColumnHeader("File Name")})
    Listview1.MultiSelect = False


    The Ones In Bold Where I Got The Errors ,
    Error 1 (else): Expression Expected
    Error 2 (windowsforms):'WindowsForms' is not declared.It may be inaccessible due to its protection level.
    Error 3 (string):'Sting' is a class type and cannot be used as an expression
    Error 4 (FileExist):'fileexist' is not a member of 'Microsoft.VisualBasic.MyServices.FileSystemProxy' .
    Error 5 (in): '.' expected

    sooo yeah they are all very basic and not a problem at all but just wanted to tell the errors and also Thanks !!!
    Last edited by GreenPro; 04-25-2013 at 10:07 AM. Reason: forgot to mention a few things

  14. #12
    DawgiiStylz's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    Dawg House
    Posts
    7,811
    Reputation
    219
    Thanks
    2,896
    My Mood
    Tired
    Quote Originally Posted by GreenPro View Post
    Hello DawgiiStylz , your code had a few errors but the errors woulden't be that hard since now i know what i did wrong and how it works and some places its just mega easy lol . . .anyways but still here are the code errors i got in vb . . . and also thanx =) !!!

    Code:
    'To open files to the list
    Dim dlg as New OpenFileDialog
    With dlg
    .MultiSelect = True
    .RestoreDirectory = True
    .Filter = "Executible Application(*.exe)|*.exe"
    .Title = "Open Files"
    End With

    If dlg.ShowDialog() = WindowsForms.DialogResult.Ok Then
    For each string in dlg.FileNames
    Dim item as new ListViewItem(else)
    item.SubItems.Add(System. IO.Path.GetFileNameWithoutExtension(ele))
    Listview1.Items.Add(item)
    Next

    'To start the selected file
    If My.Computer.FileSystem.FileExist(Listview1.FocusedItem.Text) Then
    Shell(Listview1.FocusedItem.Text) 'Shell also have additional parameters if you want a few more options
    End If

    'form load event [Mybase.Load]
    ListView1.Columns.AddRange(New ColumnHeader() {New ColumnHeader("File Path"), New ColumnHeader("File Name")})
    Listview1.MultiSelect = False


    The Ones In Bold Where I Got The Errors ,
    Error 1 (else): Expression Expected
    Error 2 (windowsforms):'WindowsForms' is not declared.It may be inaccessible due to its protection level.
    Error 3 (string):'Sting' is a class type and cannot be used as an expression
    Error 4 (FileExist):'fileexist' is not a member of 'Microsoft.VisualBasic.MyServices.FileSystemProxy' .
    Error 5 (in): '.' expected

    sooo yeah they are all very basic and not a problem at all but just wanted to tell the errors and also Thanks !!!
    Populating listview with openfiledialog
    Code:
    Dim dlg As New OpenFileDialog
            With dlg
                .Multiselect = True
                .RestoreDirectory = True
                .Filter = "Executible Application(*.exe)|*.exe"
                .Title = "Open Files"
            End With
    
    
            If dlg.ShowDialog = Windows.Forms.DialogResult.OK Then
                For Each s As String In dlg.FileNames
                    Dim item As New ListViewItem(s)
                    item.SubItems.Add(System****.Path.GetFileNameWithoutExtension(s))
                    ListView1.Items.Add(item)
                Next
            End If
    To start
    Code:
    If My.Computer.FileSystem.FileExists(ListView1.FocusedItem.Text) Then
    
    
                Shell(ListView1.FocusedItem.Text) 'Shell also have additional parameters if you want a few more options
            End If

  15. #13
    ySoNoob's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    United States
    Posts
    622
    Reputation
    31
    Thanks
    2,250
    My Mood
    Fine
    try Process.start("Put it here")



  16. #14
    GreenPro's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    My Mood
    Innocent
    Quote Originally Posted by DawgiiStylz View Post


    Populating listview with openfiledialog
    Code:
    Dim dlg As New OpenFileDialog
            With dlg
                .Multiselect = True
                .RestoreDirectory = True
                .Filter = "Executible Application(*.exe)|*.exe"
                .Title = "Open Files"
            End With
    
    
            If dlg.ShowDialog = Windows.Forms.DialogResult.OK Then
                For Each s As String In dlg.FileNames
                    Dim item As New ListViewItem(s)
                    item.SubItems.Add(System****.Path.GetFileNameWithoutExtension(s))
                    ListView1.Items.Add(item)
                Next
            End If
    To start
    Code:
    If My.Computer.FileSystem.FileExists(ListView1.FocusedItem.Text) Then
    
    
                Shell(ListView1.FocusedItem.Text) 'Shell also have additional parameters if you want a few more options
            End If
    Nice ! But is it possible to just display the icon/png/jpeg of the program instead of the whole file path ? and also how can i give an error using a label , which will say that "The File Was Not Found , It Might Have Been Changed , Removed Or Moved. Please Browse The Add The File Again If Its Still In Your Machine." And Thanks =)

  17. #15
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    Don't forget btn_credits 8-)

    "But is it possible to just display the icon/png/jpeg of the program instead of the whole file path ?"
    Sure. Google "how to add images to a ListView"...

    "and also how can i give an error using a label , which will say that "The File Was Not Found , It Might Have Been Changed , Removed Or Moved. Please Browse The Add The File Again If Its Still In Your Machine." And Thanks =)"

    If System . IO . File . Exists ( ) = False Then '' or lots of other functions.
    myLabel.Text = "paste your error message here"
    End If
    Last edited by abuckau907; 04-26-2013 at 01:55 PM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  18. The Following User Says Thank You to abuckau907 For This Useful Post:

    GreenPro (04-26-2013)

Page 1 of 2 12 LastLast

Similar Threads

  1. [Release] i wona make air wall pass glitch and i need help with fraps sentings etc
    By Diogo40440 in forum CrossFire Glitches
    Replies: 8
    Last Post: 03-15-2013, 04:02 PM
  2. [Solved] i need help with the ip programs ( To make the offers)
    By sonik12317 in forum CrossFire Help
    Replies: 7
    Last Post: 07-18-2012, 02:24 AM
  3. [Help Request] Dll I openned with NotePad need help !
    By deathtrap in forum CrossFire Help
    Replies: 9
    Last Post: 08-01-2011, 04:20 PM
  4. Opening Another Program
    By aanthonyz in forum C++/C Programming
    Replies: 15
    Last Post: 02-10-2011, 08:22 PM
  5. UCE....How to program and what i'll need.
    By scooby107 in forum WarRock - International Hacks
    Replies: 6
    Last Post: 04-17-2007, 02:23 PM

Tags for this Thread