when i right click a file and then open it then the command that windows gets is something like: notepad.exe %1, in which the %1 is the file that i clicked.
question, how can i use the %1 file in my visual basic program ?
Printable View
when i right click a file and then open it then the command that windows gets is something like: notepad.exe %1, in which the %1 is the file that i clicked.
question, how can i use the %1 file in my visual basic program ?
put this code in the load form of ur vb app.
code:
if command$ <> "" then msgbox command$
'then when u got ur program, edit the reg
' eg. C:\myapp.exe %1
Here is an example where the file is autoexec.bat
------------------Code:Dim RetVal As Integer
RetVal = Shell("C:\WINDOWS\NOTEPAD.EXE C:\AUTOEXEC.BAT", 1)
Marty
Why is it called lipstick if you can still move your lips?
i surely did not ask the right questiuon...
i right click a file(any file)
and choose - something, (i can put my program to run from the right click menu)
i want that my program will run and inside, use the file that i clicked . . . how do i do that ?
say u want to make ur own text editor??
use the above code to get the file when it is right clicked on. Once u have the file, do what ever u want to do wif it - then edit the reg
HKEY_CLASSES_ROOT\txtfile\shell\open\command
and put the name of ur app followed by the %1
eg. C:\myapp.exe %1
contact me for any further queries
ICQ: 29792493