Solved

getting the file path name dropped on the application icon

Posted on 2003-11-04
5
161 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

724 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