|
-
Nov 1st, 1999, 07:57 PM
#1
Thread Starter
Frenzied Member
How do i find a file on my hdd??
And implement it in my program
Ex. a run command??
------------------
Yours sincierly
CyberCarsten
http://homee18.inet.tele.dk/cyber/
-
Nov 1st, 1999, 08:10 PM
#2
Addicted Member
-
Nov 2nd, 1999, 02:43 AM
#3
New Member
You can use the FindFirstFile, FindNextFile, and FindClose loop listed in the URL link above to find it but if you want to execute in... you should look at the ShellExecute API. Here's an example that should work.
'Declaration
Private Const SW_SHOW As Integer = 5
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'Code
ShellExecute(0, "open", sFilename, vbNullString, vbNullString, SW_SHOW)
Note that the sFilename should be defined and in this case should be the whole path to the file.... etc. C:\windows\... you can use sFilename as the file and change the second vbNullString to the directory path.
oh, you can also change the "open" to other stuff like "print" if you want to be able to associate printing into your program.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|