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 


[VB6 Help]Finding files in .swf format
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
Pepsiguy
I post too much
Reputation: 0

Joined: 16 Aug 2007
Posts: 2016

PostPosted: Sat Feb 09, 2008 11:35 pm    Post subject: [VB6 Help]Finding files in .swf format Reply with quote

Hey, i want to make a swf loader, but i want all my swf files in one swf folder, to be detected in a list box

so say you had Banana.swf in the list box and then u put Apple.swf in it and restart the program, you will see banana and apple .swf

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Feb 10, 2008 12:02 am    Post subject: Reply with quote

API way:

FindFirstFile
FindNextFile
GetFileAttributes
FindClose

VB6 way: wait till wiccaan finds this.

edit: oops, meant GetFileAttributes. fixed now.
Back to top
View user's profile Send private message
Buggy
Advanced Cheater
Reputation: 0

Joined: 04 Jan 2008
Posts: 72
Location: Republic of Korea (South Korea)

PostPosted: Sun Feb 10, 2008 5:01 am    Post subject: Re: [VB6 Help]Finding files in .swf format Reply with quote

You might use Dir() or FSO , or FindFirstFile/FindNextFile API.
_________________

[img]
<a><img></a>[/img]
iroo sooo hooooot
Back to top
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Sun Feb 10, 2008 5:58 am    Post subject: Reply with quote

Ever used FileListBox?????
Back to top
View user's profile Send private message
Blader
I post too much
Reputation: 2

Joined: 19 Jan 2007
Posts: 2049

PostPosted: Sun Feb 10, 2008 7:36 am    Post subject: Reply with quote

FSO is a good way to do it, search on how to use it if you don't know how
_________________
Back to top
View user's profile Send private message
XxOsirisxX
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Sun Feb 10, 2008 11:14 am    Post subject: Reply with quote

VB 6.0 Example.

Like this???

Code:
Private Sub Command1_Click()
With CommonDialog1
.Filter = ("Text Files (*.swf | *.swf")
.ShowOpen
If .FileName <> "" Then
List1.AddItem (.FileName)
End If
End With
End Sub

_________________

Back to top
View user's profile Send private message
SkeleTron
Grandmaster Cheater Supreme
Reputation: 1

Joined: 28 Jun 2007
Posts: 1022

PostPosted: Sun Feb 10, 2008 12:40 pm    Post subject: Reply with quote

That's exactly I wanted to post. Same code with same control. Shocked
Like this:

Code:
Private Sub Command1_Click()
CommonDialog1.Filter = "Shockwave Flash (*.swf)|*.swf|"
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
List1.AddItem (CommonDialog1.FileName)
End If
End Sub

It does the same thing. Just your code is optimized.

_________________
Reedemer.
Back to top
View user's profile Send private message
Blader
I post too much
Reputation: 2

Joined: 19 Jan 2007
Posts: 2049

PostPosted: Sun Feb 10, 2008 12:51 pm    Post subject: Reply with quote

Ok I got my FSO code here:

Code:
On Error Resume Next
Dim fso As New FileSystemObject
Dim fld As Folder
Dim fil As File
Set fld = fso.GetFolder(App.Path & "\Directory")
For Each fil In fld.Files
  List1.AddItem fil.Name
Next
Set fil = Nothing
Set fld = Nothing
Set fso = Nothing


Gets all items in the "Directory" folder in your application's path, then adds it to a list.

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

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Sun Feb 10, 2008 1:07 pm    Post subject: Reply with quote

SciExTron wrote:
That's exactly I wanted to post. Same code with same control. Shocked
Like this:

Code:
Private Sub Command1_Click()
CommonDialog1.Filter = "Shockwave Flash (*.swf)|*.swf|"
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
List1.AddItem (CommonDialog1.FileName)
End If
End Sub

It does the same thing. Just your code is optimized.


Yea, i know, just used "With". Which is equal to use..

CommonDialog1.ShowOpen as .ShowOpen

It just applies to all, i suppose you know it. ^^



@ Blader

Somehow, i did try you code, and it just give me an error.

_________________

Back to top
View user's profile Send private message
Blader
I post too much
Reputation: 2

Joined: 19 Jan 2007
Posts: 2049

PostPosted: Sun Feb 10, 2008 1:12 pm    Post subject: Reply with quote

Oh yeah, I forgot, you need to add microsoft scripting runtime in resources section.
_________________
Back to top
View user's profile Send private message
XxOsirisxX
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Sun Feb 10, 2008 1:20 pm    Post subject: Reply with quote

Ty, it works as a charm, also show hidden/system files ^^ it's just great.

+Rep

_________________

Back to top
View user's profile Send private message
Blader
I post too much
Reputation: 2

Joined: 19 Jan 2007
Posts: 2049

PostPosted: Sun Feb 10, 2008 1:26 pm    Post subject: Reply with quote

Thanks, although it was for the topic starter
Btw, you just got 1337 posts XD

_________________
Back to top
View user's profile Send private message
Pepsiguy
I post too much
Reputation: 0

Joined: 16 Aug 2007
Posts: 2016

PostPosted: Sun Feb 10, 2008 6:08 pm    Post subject: Reply with quote

Blader wrote:
Oh yeah, I forgot, you need to add microsoft scripting runtime in resources section.
how do you do that its not working for me
_________________
Back to top
View user's profile Send private message
Blader
I post too much
Reputation: 2

Joined: 19 Jan 2007
Posts: 2049

PostPosted: Sun Feb 10, 2008 6:11 pm    Post subject: Reply with quote

Project > Resources then search for it
_________________
Back to top
View user's profile Send private message
Pepsiguy
I post too much
Reputation: 0

Joined: 16 Aug 2007
Posts: 2016

PostPosted: Sun Feb 10, 2008 6:17 pm    Post subject: Reply with quote

no resources, just references and it says invalid ouside procedure
_________________
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