🔒 Locked
Drag-drop executing
Advertisement
Original Post
I use several programs that are run by dragging an input file on top of the executable. This intrigues me. How is it done? Does it just send the input file''s name to argv? Do you have to add something to the code to make it work, or does it work automatically?
Thanks
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
Cool. Thanks.
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
Assuming that you''re talking about a running program on Windows look at the documentation for WM_DROPFILES (win32), CWnd::OnDropFiles (MFC), or Control.DragDrop Event (.Net).
Well, I have it working now so that it outputs argv. The only problem is, it outputs the entire file name, directory included. Is there a way I can have it cut off the directory? I suppose I could have it just clear out the string every time a \ is detected, but that feels a bit hacked. Is there a better way?
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
Well, I want to create variables and such just based on the file name.
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
If you do not mind limiting yourself to windows only you can use PathStripPath().
[edited by - mauman on April 19, 2004 5:23:38 PM]
[edited by - mauman on April 19, 2004 5:23:38 PM]
Great. Thanks alot guys. I have it working now.
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement