Results 1 to 3 of 3

Thread: Find File

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg , Denmark
    Posts
    1,544

    Post

    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/

  2. #2

  3. #3
    New Member
    Join Date
    Oct 1999
    Location
    Birmingham, Al, United States
    Posts
    10

    Post

    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
  •  



Click Here to Expand Forum to Full Width