Click to See Complete Forum and Search --> : Using DDE with Visual basic
docHoliday
Dec 4th, 1999, 07:48 AM
I'm not 100% sure if DDE is the method, but I'd like to pass file information to my small text editor app so that when you double click on a text file, it launches the app and opens the file. Thus far I have been able to make my app the deafult text editing progam, but failed tring to get the file opening functionality to work?
Anyone have any suggestions or know of an API to use to accomplish this?
Frans C
Dec 4th, 1999, 10:50 PM
If you have got windows to launch your app when double clicking on the file, all you have to do is open the file passed to your app in the commandline. Something like this:
ption Explicit
Private Sub Form_Load()
Dim hFile As Integer
Dim Text As String
If Len(Command) > 0 Then
If Dir(Command) <> "" Then
hFile = FreeFile
Open Command For Input As #hFile
Text = Input(LOF(hFile), #hFile)
Close #hFile
Text1.Text = Text
End If
End If
End Sub
docHoliday
Dec 5th, 1999, 04:34 AM
Thanks a lot. I'll give it a try.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.