CyberCarsten
Nov 1st, 1999, 06:57 PM
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/
smalig
Nov 1st, 1999, 07:10 PM
See tip at http://www.vb-world.net/ubb/Forum1/HTML/009800.html
------------------
smalig
smalig@hotmail.com
smalig.tripod.com (http://smalig.tripod.com)
clint_22
Nov 2nd, 1999, 01:43 AM
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.