Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
void EnableShellOpen();
Remarks
Call this function, typically from your InitInstance override, to enable your application’s users to open data files when they double-click the files from within the Windows File Manager. Call the RegisterShellFileTypes member function in conjunction with this function, or provide a .REG file with your application for manual registration of document types.
Example
BOOL CMyApp::InitInstance()
{
// ...
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MYTYPE,
RUNTIME_CLASS(CMyDoc),
RUNTIME_CLASS(CMDIChildWnd), // standard MDI child frame
RUNTIME_CLASS(CMyView));
AddDocTemplate(pDocTemplate);
// Create main MDI Frame window.
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
// Save the pointer to the main frame window. This is the
// only way the framework will have knowledge of what the
// main frame window is.
m_pMainWnd = pMainFrame;
// enable file manager drag/drop and DDE Execute open
EnableShellOpen();
RegisterShellFileTypes();
// ...
// Show the main window using the nCmdShow parameter
// passed to the application when it was first launched.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
// ...
}
CWinApp Overview | Class Members | Hierarchy Chart
See Also CWinApp::OnDDECommand, CWinApp::RegisterShellFileTypes