Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Browse and open .exe
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
angerist
Grandmaster Cheater Supreme
Reputation: 0

Joined: 18 Jun 2007
Posts: 1011
Location: Australia.

PostPosted: Sat May 24, 2008 12:39 am    Post subject: Browse and open .exe Reply with quote

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 Wink

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
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Sat May 24, 2008 1:35 am    Post subject: Reply with quote

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
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Sat May 24, 2008 2:38 am    Post subject: Reply with quote

You need CommonDialogControls or something like that if I remember correctly. It contains the standard Open dialog.
Back to top
View user's profile Send private message
angerist
Grandmaster Cheater Supreme
Reputation: 0

Joined: 18 Jun 2007
Posts: 1011
Location: Australia.

PostPosted: Sat May 24, 2008 3:03 am    Post subject: Reply with quote

Hmmm.. Common Dialog controlls isnt in components
_________________
Back to top
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Sat May 24, 2008 3:13 am    Post subject: Reply with quote

MICROSOFT common dialog i think.
Back to top
View user's profile Send private message
Typhoon808
Expert Cheater
Reputation: 0

Joined: 27 Mar 2008
Posts: 175
Location: Wales

PostPosted: Sat May 24, 2008 3:29 am    Post subject: Reply with quote

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
View user's profile Send private message
angerist
Grandmaster Cheater Supreme
Reputation: 0

Joined: 18 Jun 2007
Posts: 1011
Location: Australia.

PostPosted: Sat May 24, 2008 4:49 am    Post subject: Reply with quote

Yeh a snippet would be great. But you gave me a good picture. Im progressing.
_________________
Back to top
View user's profile Send private message
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Sat May 24, 2008 8:50 am    Post subject: Reply with quote

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
View user's profile Send private message
Typhoon808
Expert Cheater
Reputation: 0

Joined: 27 Mar 2008
Posts: 175
Location: Wales

PostPosted: Sat May 24, 2008 12:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
angerist
Grandmaster Cheater Supreme
Reputation: 0

Joined: 18 Jun 2007
Posts: 1011
Location: Australia.

PostPosted: Sat May 24, 2008 7:47 pm    Post subject: Reply with quote

Great work Very Happy . 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 Wink . Fight over it rofl.
_________________
Back to top
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Sat May 24, 2008 9:43 pm    Post subject: Reply with quote

angerist wrote:
Great work Very Happy . 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 Wink . Fight over it rofl.


Me Very Happy

Shell is really all you needed.

Or your making this for really lazy people.

_________________
Back to top
View user's profile Send private message
angerist
Grandmaster Cheater Supreme
Reputation: 0

Joined: 18 Jun 2007
Posts: 1011
Location: Australia.

PostPosted: Sun May 25, 2008 12:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Sun May 25, 2008 12:28 am    Post subject: Reply with quote

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
View user's profile Send private message
angerist
Grandmaster Cheater Supreme
Reputation: 0

Joined: 18 Jun 2007
Posts: 1011
Location: Australia.

PostPosted: Sun May 25, 2008 3:05 am    Post subject: Reply with quote

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
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Sun May 25, 2008 3:41 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites