Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8762497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:32:44+00:00 2026-06-13T15:32:44+00:00

I am trying to add support for Send to from window explorer right click

  • 0

I am trying to add support for “Send to” from window explorer right click context menu feature into my MFC application. For this I’ve parsed command line argument m_lpCmdLine in InitInstance() to get the file path and opened it. This is the case when application is not running.

But in case when application is already running. Then in this case I don’t want to create a new instance.

What will be needed for passing these command line options, to already existing instance.

Any suggestions will be very helpful.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T15:32:45+00:00Added an answer on June 13, 2026 at 3:32 pm

    Thanks I got the solution!

    I need to find the handle of the open instance and the send message along with data which will be handle in CMainFrame class.

    CWnd*  pCWnd;
    if(pCWnd = CWnd::FindWindow(_T("MyApplication"), NULL))
    {
        if(m_lpCmdLine != '\0')
        {
            COPYDATASTRUCT cds;
            memset(&cds, 0, sizeof(cds));
    
            cds.dwData = MY_ACTION;
            cds.cbData = strlen(m_lpCmdLine) + 1;
            cds.lpData = (LPVOID) (LPCTSTR)m_lpCmdLine;
    
            pCWnd->SendMessage(WM_COPYDATA,(WPARAM)NULL, (LPARAM)&cds);
        }
    }
    

    Now in,

    MainFrame::OnCopyData()
    {
    }
    

    we can get this value.

    For more detail description, read inter-process communication chapter of “Multithreading Application in Win32”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add globalization support to my C# application. According to MSDN, there
I'm trying to add support for tracking application usage to a WP7 app (e.g.,
I'm trying to add Mobclix Support into my app, and I don't want to
I am trying to add support for different languages to existing MVC 3 application.
I'm getting the following error from g++ while trying to add iterator support for
I'm trying to add iCal import support to my existing scheduling application which needs
I'm trying to add support into showdown.js for code fencing, but I'm still sort
I'm trying to add multi-language support to an OpenSocial application. I see that I
I am trying to add full screen support to my cocoa application and I
I'm trying to add JPA support for my app however, I'm getting this error:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.