?
Solved

getting the file path name dropped on the application icon

Posted on 2003-11-04
5
Medium Priority
?
162 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 252 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 248 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

771 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