本文整理汇总了C++中CDialog::CenterWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ CDialog::CenterWindow方法的具体用法?C++ CDialog::CenterWindow怎么用?C++ CDialog::CenterWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDialog
的用法示例。
在下文中一共展示了CDialog::CenterWindow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scan
VSTPluginLib *CSelectPluginDlg::ScanPlugins(const mpt::PathString &path, CWnd *parent)
//------------------------------------------------------------------------------------
{
CVstPluginManager *pManager = theApp.GetPluginManager();
VSTPluginLib *plugLib = nullptr;
bool update = false;
CDialog pluginScanDlg;
pluginScanDlg.Create(IDD_SCANPLUGINS, parent);
pluginScanDlg.CenterWindow(parent);
pluginScanDlg.ModifyStyle(0, WS_SYSMENU, WS_SYSMENU);
pluginScanDlg.ShowWindow(SW_SHOW);
FolderScanner scan(path, true);
mpt::PathString fileName;
int files = 0;
while(scan.NextFile(fileName) && pluginScanDlg.IsWindowVisible())
{
if(!mpt::PathString::CompareNoCase(fileName.GetFileExt(), MPT_PATHSTRING(".dll")))
{
CWnd *text = pluginScanDlg.GetDlgItem(IDC_SCANTEXT);
std::wstring scanStr = L"Scanning Plugin...\n" + fileName.ToWide();
::SetWindowTextW(text->m_hWnd, scanStr.c_str());
MSG msg;
while(::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
VSTPluginLib *lib = pManager->AddPlugin(fileName, mpt::ustring(), false);
if(lib)
{
update = true;
if(!VerifyPlug(lib, parent))
{
pManager->RemovePlugin(lib);
} else
{
plugLib = lib;
files++;
}
}
}
}
if(update)
{
// Force selection to last added plug.
Reporting::Information(mpt::String::Print("Found %1 plugin%2.", files, files == 1 ? "" : "s").c_str(), parent);
return plugLib;
} else
{
Reporting::Error("Could not find any valid VST plugins.");
return nullptr;
}
}