本文整理汇总了C++中CDialog::ModifyStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ CDialog::ModifyStyle方法的具体用法?C++ CDialog::ModifyStyle怎么用?C++ CDialog::ModifyStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDialog
的用法示例。
在下文中一共展示了CDialog::ModifyStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例2: CreatePage
/////////////////////////////////////////////////////////////////////////////
// CSettingsDialog::CreatePage(const PAGE_INFO *pInfo)
// Description: Create the Window of the page specified by the page info.
// Return value: TRUE if successful, or FALSE if failed
//
BOOL CSettingsDialog::CreatePage(const PAGE_INFO *pInfo)
{
BOOL bCode = FALSE;
if (!pInfo || !pInfo->pWnd) return(FALSE); // If no page is specified, return NULL
if (!::IsWindow(pInfo->pWnd->m_hWnd)) // If the window has not yet been created,
{
if (pInfo->pWnd->IsKindOf(RUNTIME_CLASS(CDialog))) // If the page indow is kind of dialog window
{
CDialog *pDlg = (CDialog*)pInfo->pWnd;
bCode = pDlg->Create(pInfo->nID, this);
pDlg->ModifyStyle(WS_CAPTION, 0);
}
else if (pInfo->pWnd->IsKindOf(RUNTIME_CLASS(CWnd))) // generic CWnd derived Window
{
CWnd *pWnd = (CWnd*)pInfo->pWnd;
bCode = CreateWnd(pInfo->pWnd); // Create Window
pWnd->ModifyStyle(WS_BORDER|WS_THICKFRAME, 0); // Remoce border and thick frame styles
}
}
return(bCode);
}