|
-
May 15th, 2001, 12:31 PM
#1
Thread Starter
Member
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.
-
May 15th, 2001, 01:23 PM
#2
PowerPoster
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
-
May 15th, 2001, 02:18 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|