Results 1 to 3 of 3

Thread: Find File

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Aalborg , Denmark


    How do i find a file on my hdd??
    And implement it in my program
    Ex. a run command??

    Yours sincierly

  2. #2

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


    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.

    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

    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