Solved

getting the file path name dropped on the application icon

Posted on 2003-11-04
5
157 Views
Last Modified: 2013-11-20
How would I write a Windows application which is represented as an icon on the desktop and the user could drag files and drop them on the top of the icon and thus the application should be able to get the file path name and store it in a text file. Please help I have no idea how to start. I am using Windows xp platform.
0
Comment
Question by:programmer2003a
5 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 63 total points
ID: 9684552
You need to handle the command-line parameters. When shortcut to your application is placed on the desktop, and user drags and drops file(s) into this shortcut, Windows shell calls your application with names of these files in the command line.
0
 
LVL 49

Assisted Solution

by:DanRollins
DanRollins earned 62 total points
ID: 9684948
In an MFC app, you can obtain the command-line parameters by examining the CWinApp::m_lpCmdLine like so:

    CString sCmdLine= AfxGetApp()->m_lpCmdLine;

There is also a handy mechanism for processing each parameter separately.  It is documented as the CCommandLineInfo object:

      http://msdn.microsoft.com/library/en-us/vcmfc98/html/_mfc_ccommandlineinfo.asp

I can provide some simple code if you really need it.
-- Dan
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now