Results 1 to 3 of 3

Thread: Help me in my first API Application

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Posts
    36

    Help me in my first API Application

    Hello,

    I have a table storing picture filenames (.tif, .jpg, etc) and I am populating it on a DataGrid. The user is expected to double-click a particular row on the DataGrid to open up the selected filename in "Imaging" application (c:\windows\kodakimg.exe) which is shipped with Win98 (Start >Programs >Accessories >Imaging). After the user closes the "Imaging" application, control should return back to our program.

    Kindly spare a moment to explain me how this can be accomplished using API calls. You may instruct only the API coding part, the rest is ready with me.

    Thank you in advance,

    James.

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Use the ShellExecute api call
    Code:
    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
    Const SW_SHOWNORMAL = 1
    Private Sub Form_Load()
        ShellExecute Me.hwnd, vbNullString, "c:\windows\kodakimg.exe", vbNullString, "C:\", SW_SHOWNORMAL
    End Sub

  3. #3
    Megatron
    Guest
    You don't even need API for this. Use VB's Shell method.
    Code:
    Shell "c:\windows\kodakimg.exe MyImgFile.jpg", 1

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