本文整理汇总了C++中CDialog::GetDlgItem方法的典型用法代码示例。如果您正苦于以下问题:C++ CDialog::GetDlgItem方法的具体用法?C++ CDialog::GetDlgItem怎么用?C++ CDialog::GetDlgItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDialog
的用法示例。
在下文中一共展示了CDialog::GetDlgItem方法的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: Translate
void Languages::Translate(CDialog& dialog, UINT nResourceID)
{
//set translated text for every know control ID
for (int iID = 0; iID < _APS_NEXT_CONTROL_VALUE; iID++)
{
mapitem_t::iterator ite = m_mItems.find(iID);
if(ite != m_mItems.end() && dialog.GetDlgItem(iID))
{
dialog.SetDlgItemText(iID, ite->second);
}
}
//set translated text on the dialog
mapitem_t::iterator ite = m_mItems.find(nResourceID);
if(ite != m_mItems.end())
dialog.SetWindowText(ite->second);
//else
// TRACE(_T("Missing Item ID %d\n"), nResourceID);
CMenu* menu = dialog.GetMenu();
if(menu)
Translate(*menu);
}