In mainfrm use, there is no effect
PSubMenu=pMenu - & gt; GetSubMenu (1);
PSubMenu - & gt; EnableMenuItem (ID_CFG,
MF_BYCOMMAND
| MF_DISABLED
| MF_GRAYED);
if (! ProcessShellCommand (cmdInfo))
Return FALSE;
When the initial create multiple Windows, use the registration document template, how to obtain each window VIEW of pointer,
Use this code in mainfrm, couldn't get
CWinApp * pApp=AfxGetApp ();
The POSITION PosDocTemplate=pApp - & gt; GetFirstDocTemplatePosition ();
While (PosDocTemplate)
{
CDocTemplate * pDocTemplate=pApp - & gt; GetNextDocTemplate (PosDocTemplate);
The POSITION PosDoc=pDocTemplate - & gt; GetFirstDocPosition ();
While (PosDoc)
{
CDocument * pDoc=pDocTemplate - & gt; GetNextDoc (PosDoc);
The POSITION PosView=pDoc - & gt; GetFirstViewPosition ();//here for empty
While (PosView)
{
The CView * pView=pDoc - & gt; GetNextView (PosView);
}
}
}
How to set up the document window to the front of the most,
Press each button to each window to the top
CMultiDocTemplate * pDocTemplate;
PDocTemplate=new CMultiDocTemplate (IDR_MAINFRAME,
RUNTIME_CLASS (CHDRGuiDoc),
RUNTIME_CLASS (CChildFrame),//a custom frame of MDI child
RUNTIME_CLASS (CHDRGuiView1));
if (! PDocTemplate)
Return FALSE;
AddDocTemplate (pDocTemplate);
//create a main MDI frame window
CMainFrame * pMainFrame=new CMainFrame;
if (! PMainFrame | |! PMainFrame - & gt; LoadFrame (IDR_MAINFRAME))
{
The delete pMainFrame;
Return FALSE;
}
M_pMainWnd=pMainFrame;
//only when it has the suffix call DragAcceptFiles
//in an MDI application, this should happen immediately after setting m_pMainWnd
//m_hInitMenu=: : LoadMenu (HLNST, MAKEINTRESOURCE (IDR_MAINFRAME));
//m_hOPMenu=: : LoadMenu (HLNST, MAKEINTRESOURCE (IDR_HDRGuiTYPE));
/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- Add by tong -- -- -- -- -- -- -- -- -- -- */
//the main window and each child window (file window) are willing to accept from the Shell drag and drop files
M_pMainWnd - & gt; DragAcceptFiles (TRUE);
//when the Shell on the program files fast by two times, the program can open the file and read
EnableShellOpen ();
//registered the program file type with the Shell,
RegisterShellFileTypes (TRUE);
/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - */
//the analysis standard shell command, DDE, open the file operations command line
CCommandLineInfo cmdInfo;
ParseCommandLine (cmdInfo);
//scheduling command specified on the command line, if
//use/RegServer/Register,/Unregserver or Unregister start the application, it returns FALSE,
if (! ProcessShellCommand (cmdInfo))
Return FALSE;
if (! ProcessShellCommand (cmdInfo))
Return FALSE;
if (! ProcessShellCommand (cmdInfo))
Return FALSE;
if (! ProcessShellCommand (cmdInfo))
Return FALSE;
//the main window has been initialized, so show and update it
//the main window to start to maximize
PMainFrame - & gt; ShowWindow (SW_SHOWMAXIMIZED/* */m_nCmdShow);
PMainFrame - & gt; UpdateWindow ();
Return TRUE;
CodePudding user response:
for helpCodePudding user response:
Under the top ,,,,,,,,CodePudding user response:
ON_UPDATE_COMMAND_UI ()PCmdUI - & gt; The Enable (FALSE);
CodePudding user response:
How to set OnUpdateCommandUICodePudding user response: