CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    1

    ShellExec Function



    I was wondering if anybody could tell me the name of the refernce to the current file that is open in an MDI document.

    I need to pass the current file in the window through the SHellExecute function to my browser and I have looked for it

    with no luck. I built it using the MFC APPWizard so if anybody knows please help me. Here is the code I used

    void CMainFrame::OnPreviewBrowser()

    {

    // Run the browser with a file

    if (m_Dlg.m_Path != "&quot

    {

    ShellExecute(name of active file????,"open",m_Dlg.m_Path, NULL, NULL, SW_SHOW);

    }

    }



  2. #2
    Join Date
    Apr 1999
    Posts
    5

    Re: ShellExec Function



    The first parameter of ShellExecute is a handle to the parent window (HWND).

    You can probably use the CWnd function GetSafeHwnd() or NULL.


    Good Luck!


    /Peter Lundqvist

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured