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 


Question on VB

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
bobobobbins
Expert Cheater
Reputation: 0

Joined: 28 Jun 2007
Posts: 120
Location: someplace

PostPosted: Fri Jan 04, 2008 4:22 am    Post subject: Question on VB Reply with quote

For visual basic can someone show me how to make a simple program where i put in buttons to go to a directory and open a file i wish to open?
can u do kinda what u do in delphi were u do the shellexecute thing?
Back to top
View user's profile Send private message
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Fri Jan 04, 2008 7:18 am    Post subject: Reply with quote

Chuck this into a module.
Code:

Public Declare Function SHBrowseForFolder Lib "SHELL32" (lpBI As BrowseInfo) As Long
Public Declare Function SHGetPathFromIDList Lib "SHELL32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long
Public Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long

Private Type BrowseInfo
    hwndOwner As Long
    pIDLRoot As Long
    pszDisplayName As Long
    lpszTitle As Long
    ulFlags As Long
    lpfnCallback As Long
    lParam As Long
    iImage As Long
End Type

Public Const BIF_RETURNONLYFSDIRS = 1
Public Const BIF_DONTGOBELOWDOMAIN = 2
Public Const BIF_BROWSEFORCOMPUTER = &H1000
Public Const MAX_PATH = 260

Public Function BrowseForFolder(Owner As Long, Optional szTitle As String = "Select Folder...") As String
    Dim lpIDList As Long
    Dim sBuffer As String
    Dim tBrowseInfo As BrowseInfo

    With tBrowseInfo
        .hwndOwner = Owner
        .lpszTitle = lstrcat(szTitle, "")
        .ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN
    End With
    lpIDList = SHBrowseForFolder(tBrowseInfo)

    If (lpIDList) Then
        sBuffer = Space(MAX_PATH)
        SHGetPathFromIDList lpIDList, sBuffer
        sBuffer = Left(sBuffer, InStr(sBuffer, vbNullChar) - 1)
        BrowseForFolder = sBuffer
    End If
End Function

And this is how you call it...
Code:
Private Sub Command1_Click()
    MsgBox BrowseForFolder(Me.hWnd)
End Sub


Sorry, it does have to be that long in vb6. did you say vb6?

_________________
Get kidnapped often.
Back to top
View user's profile Send private message
Lolkittycat
Advanced Cheater
Reputation: 0

Joined: 02 Jan 2008
Posts: 50
Location: At a farm

PostPosted: Fri Jan 04, 2008 7:20 am    Post subject: Reply with quote

What version?
_________________
Stop piracy, dont be a duche
Back to top
View user's profile Send private message
BEO-WULF
Expert Cheater
Reputation: 0

Joined: 27 Jan 2008
Posts: 138
Location: Green Bay, Wisconsin

PostPosted: Sat Feb 02, 2008 1:21 am    Post subject: Reply with quote

some times the vb's do have to be a certain length and highth for them to work just found that out like 10 minutes ago lol Rolling Eyes Wink
_________________


4 L1F3 ( + [__] : : ) 4 L1F3
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
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