[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

getting the file path name dropped on the application icon

Posted on 2003-11-04
5
Medium Priority
?
163 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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…
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, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

650 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