Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

determine if PRG was launched from drap/drop operation

Status
Not open for further replies.

msc0tt

IS-IT--Management
Jun 25, 2002
281
CA
I have a program that processes a text file. The program gets the name of the file to process from the command line (MYPROG.EXE c:\events.log).
Using Win Explorer, I would like to be able to 'drop' my events.log on the MYPROG.EXE program and have it go to work.
I'm hoping this is embarrasingly simple.

btw: I checked the FAQs first -zip. Unfortunately, the SEARCH tool is down right now, so my apologies if this ques/answer is already in the forum.
 
I hope this is embarrasingly simple.... I believe that by default if you "drop" a file onto an exe from Windows Explorer, it will pass the filename to the program as the first parameter.

So, if you drag the file "C:\Foo.txt" and drop it onto myprog.exe, you'll get the equivalent command line of:

MYPROG.EXE C:\Foo.txt
 
Hahaha...
Dammed if this doesn't work!! It never even occured to me to try this. -many thanks.
 
Ummm I think there is a bit of confusion. Command line arguements are from when the app first starts. After it is running those arguements do not change so dropping a file on a exe wont do anything to those parameters. You have to code for OLE_Drag drop yourself. I've posted snippets before. Its not a 1 line thing. Drag & Drop is completely different from command line arguements.
 
You are correct, but I believe mscott was looking for dropping an object onto his "non-running" shortcut, not dropping onto a currently running program.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top