Solved

getting the file path name dropped on the application icon

Posted on 2003-11-04
5
156 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

10 Experts available now in Live!

Get 1:1 Help Now