本文整理汇总了C++中MainFrame::ApplyWindowPlacement方法的典型用法代码示例。如果您正苦于以下问题:C++ MainFrame::ApplyWindowPlacement方法的具体用法?C++ MainFrame::ApplyWindowPlacement怎么用?C++ MainFrame::ApplyWindowPlacement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainFrame
的用法示例。
在下文中一共展示了MainFrame::ApplyWindowPlacement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInit
bool MainApp::OnInit()
{
UINT openFilesMessage = RegisterWindowMessage("Decoda_OpenFiles");
// Check to see if another instances is running.
if (!wxApp::OnInit())
{
return false;
}
wxImage::AddHandler(new wxXPMHandler);
wxImage::AddHandler(new wxPNGHandler);
MainFrame* frame = new MainFrame("Script Debugger", openFilesMessage, wxDefaultPosition, wxSize(1024,768));
HWND hWndPrev = m_singleInstance.Connect(reinterpret_cast<HWND>(frame->GetHandle()), "Decoda");
// If we're loading files from the command line (but not a project) file,
// then don't create a new instance. This happens when the user double clicks
// in Explorer.
if (hWndPrev != NULL && m_loadProjectName.IsEmpty() && m_debugExe.IsEmpty() && m_loadFileNames.Count() > 0)
{
// Send the command line to the other window.
wxString fileNames;
for (unsigned int i = 0; i < m_loadFileNames.Count(); ++i)
{
fileNames += m_loadFileNames[i] + ";";
}
m_singleInstance.SetCommand(fileNames);
PostMessage(hWndPrev, openFilesMessage, 0, 0);
// Show the other window.
SetForegroundWindow(hWndPrev);
delete frame;
return false;
}
frame->ApplyWindowPlacement();
// If a project was specified, open it.
if (!m_loadProjectName.IsEmpty())
{
frame->OpenProject(m_loadProjectName);
}
// Load any files that were specified on the command line.
frame->OpenDocuments(m_loadFileNames);
// Tell the UI to load the last project if we haven't instructed.
// it to load anything else.
if (m_loadProjectName.IsEmpty() && m_loadFileNames.IsEmpty())
{
frame->AutoOpenLastProject();
}
m_loadProjectName.Clear();
m_loadFileNames.Clear();
frame->CheckForUpdate();
if (!m_debugExe.IsEmpty())
{
frame->DebugExe(m_debugExe);
}
return true;
}