-
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 != "")
{
ShellExecute(name of active file????,"open",m_Dlg.m_Path, NULL, NULL, SW_SHOW);
}
}
-
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