View previous topic :: View next topic |
Author |
Message |
angerist Grandmaster Cheater Supreme
Reputation: 0
Joined: 18 Jun 2007 Posts: 1011 Location: Australia.
|
Posted: Sat May 24, 2008 12:39 am Post subject: Browse and open .exe |
|
|
I dont usually code in VB. Infact this is the first time . I've searched around but all of the results are not quite what I want. I want to Browse for an .exe in this case MapleStory.exe and once found I want to start the .exe. Does anyone know how to do this??
All I know is that you need a text box and a command button. + rep to helpfull person who gives me this information. Have a nice day everyone
Example: When you upload somthing it says browse, and you search for what you want to upload. But I want to execute.
I know my examples lame but thats all i could think of. Looking forward to your replys.
_________________
|
|
Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Sat May 24, 2008 1:35 am Post subject: |
|
|
Yes. If you want to strictly open Maplestory.exe:
For example this code could go into a command button:
Code: | Shell("C://documents/etc/etc/etc/maplestory.exe", vbNormalFocus) |
Not sure how to browse though... you could do this:
Code: | Shell("explorer.exe", vbNormalFocus) |
Which would open up the page where you can browse for maplestory.exe
_________________
|
|
Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sat May 24, 2008 2:38 am Post subject: |
|
|
You need CommonDialogControls or something like that if I remember correctly. It contains the standard Open dialog.
|
|
Back to top |
|
 |
angerist Grandmaster Cheater Supreme
Reputation: 0
Joined: 18 Jun 2007 Posts: 1011 Location: Australia.
|
Posted: Sat May 24, 2008 3:03 am Post subject: |
|
|
Hmmm.. Common Dialog controlls isnt in components
_________________
|
|
Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Sat May 24, 2008 3:13 am Post subject: |
|
|
MICROSOFT common dialog i think.
|
|
Back to top |
|
 |
Typhoon808 Expert Cheater
Reputation: 0
Joined: 27 Mar 2008 Posts: 175 Location: Wales
|
Posted: Sat May 24, 2008 3:29 am Post subject: |
|
|
Use a BrowseFileDialog to find the file and when you hit OK, make the directory of the file go into a text or a variable. Then shell the variable.
You can also use System.Diagnostics.Process.Start instead of shell.
If you need a snippet, just say so.
|
|
Back to top |
|
 |
angerist Grandmaster Cheater Supreme
Reputation: 0
Joined: 18 Jun 2007 Posts: 1011 Location: Australia.
|
Posted: Sat May 24, 2008 4:49 am Post subject: |
|
|
Yeh a snippet would be great. But you gave me a good picture. Im progressing.
_________________
|
|
Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Sat May 24, 2008 8:50 am Post subject: |
|
|
Are you using .Net or VS6? .. ._.
.Net (C#; your code will differ slightly (I need to reinstall VB2k8 lol))
Code: | OpenFileDialog oFD = new OpenFileDialog();
oFD.Filter = "Maple Story|maplestory.exe|Executables|*.exe|All files|*.*";
if (oFD.ShowDialog() == DialogResult.OK)
System.Diagnostics.Process.Start(oFD.FileName); |
VS6.0
Code: | Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Private Sub Command1_Click()
Dim openFile As OPENFILENAME
openFile.lStructSize = Len(openFile)
openFile.hInstance = App.hInstance
openFile.hwndOwner = Me.hWnd
openFile.lpstrFilter = Replace("Maple Story|maplestory.exe|Executables|*.exe|All files|*.*", "|", Chr(0))
If GetOpenFileName(openFile) <> 0 Then
Call Shell(openFile.lpstrFile)
Else
'MsgBox "User cancelled"
End If
End Sub |
Or if you use the Microsoft Common Dialog Control, add it to the form then:
Code: | Private Sub Command1_Click()
CommonDialog1.Filter = "Maple Story|maplestory.exe|Executables|*.exe|All files|*.*"
CommonDialog1.CancelError = True
On Error GoTo ErrH
CommonDialog1.ShowOpen
Shell CommonDialog1.FileName, vbNormalFocus
Exit Sub
ErrH:
'User cancelled.
End Sub |
That help?
|
|
Back to top |
|
 |
Typhoon808 Expert Cheater
Reputation: 0
Joined: 27 Mar 2008 Posts: 175 Location: Wales
|
Posted: Sat May 24, 2008 12:07 pm Post subject: |
|
|
Code: |
Imports System.IO
Public Class Form1
Public Sub BrowseFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BrowseFile.Click
Dim FolderBrowseDialog As New OpenFileDialog
With FolderBrowseDialog
.Filter = "Executable files (*.exe)|*.exe|" & "All files|*.*"
.InitialDirectory = "C:"
.RestoreDirectory = True
If .ShowDialog = Windows.Forms.DialogResult.OK Then 'On file selected
txtFileDirectory.Text = .FileName
Shell(txtFildirectory.Text) 'Open the selected directory
End If
End With
End Sub
|
Simple browse for a file and open it.
|
|
Back to top |
|
 |
angerist Grandmaster Cheater Supreme
Reputation: 0
Joined: 18 Jun 2007 Posts: 1011 Location: Australia.
|
Posted: Sat May 24, 2008 7:47 pm Post subject: |
|
|
Great work . Its not finished. Just a simple injector . Browse for you dll . Browse for your .exe. Its on maplestory main page. Thank you all to helped me. Who the fark deserves a rep . Fight over it rofl.
_________________
|
|
Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Sat May 24, 2008 9:43 pm Post subject: |
|
|
angerist wrote: | Great work . Its not finished. Just a simple injector . Browse for you dll . Browse for your .exe. Its on maplestory main page. Thank you all to helped me. Who the fark deserves a rep . Fight over it rofl. |
Me
Shell is really all you needed.
Or your making this for really lazy people.
_________________
|
|
Back to top |
|
 |
angerist Grandmaster Cheater Supreme
Reputation: 0
Joined: 18 Jun 2007 Posts: 1011 Location: Australia.
|
Posted: Sun May 25, 2008 12:01 am Post subject: |
|
|
Nah I know the shell function. Im searching for a exe thats in a different directory for different computers. So I need a browse function.
_________________
|
|
Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Sun May 25, 2008 12:28 am Post subject: |
|
|
What IDE are you using? For future reference when I post to help out.
VB.Net or VB 6.0?
You should give the person who gave you the answer you needed the rep.
|
|
Back to top |
|
 |
angerist Grandmaster Cheater Supreme
Reputation: 0
Joined: 18 Jun 2007 Posts: 1011 Location: Australia.
|
Posted: Sun May 25, 2008 3:05 am Post subject: |
|
|
Im using VB6. I dont usually code in VB. I code in delphi and C#. But I thought i'd give vb6 a try. The injector turned out ok.
_________________
Last edited by angerist on Sun May 25, 2008 3:55 am; edited 1 time in total |
|
Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Sun May 25, 2008 3:41 am Post subject: |
|
|
You could tell the users to put the hack in the same dir where MS is.
Then you would use Code: | shell app.path & "/Maplestory.exe" |
|
|
Back to top |
|
 |
|