本文整理汇总了C++中EndWaitCursor函数的典型用法代码示例。如果您正苦于以下问题:C++ EndWaitCursor函数的具体用法?C++ EndWaitCursor怎么用?C++ EndWaitCursor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EndWaitCursor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BeginWaitCursor
bool CModDoc::PasteEnvelope(INSTRUMENTINDEX nIns, EnvelopeType nEnv)
//----------------------------------------------------------------------
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
if (nIns < 1 || nIns > m_SndFile.m_nInstruments || !m_SndFile.Instruments[nIns] || !pMainFrm) return false;
BeginWaitCursor();
if (!pMainFrm->OpenClipboard())
{
EndWaitCursor();
return false;
}
HGLOBAL hCpy = ::GetClipboardData(CF_TEXT);
LPCSTR p;
bool result = false;
if ((hCpy) && ((p = (LPSTR)GlobalLock(hCpy)) != nullptr))
{
std::string data(p, p + GlobalSize(hCpy));
GlobalUnlock(hCpy);
CloseClipboard();
result = StringToEnvelope(data, m_SndFile.Instruments[nIns]->GetEnvelope(nEnv), m_SndFile.GetModSpecifications());
}
EndWaitCursor();
return result;
}
示例2: GetPathName
void CDIPDemoDoc::OnFileReopen()
{
// 重新打开图像,放弃所有修改
// 判断当前图像是否已经被改动
if ( IsModified() )
{
// 提示用户该操作将丢失所有当前的修改
if ( MessageBox ( NULL,
L"重新打开图像将丢失所有改动!是否继续?",
L"系统提示", MB_ICONQUESTION | MB_YESNO ) == IDNO )
{
// 用户取消操作,直接返回
return;
}
}
CString strPathName;
// 获取当前文件路径
strPathName = GetPathName();
// 更改光标形状
BeginWaitCursor();
if ( !m_Image.AttachFromFile ( strPathName ) )
{
EndWaitCursor();
AfxMessageBox ( L"打开文件时出错!请确保正确的位图(*.bmp)文件类型。" );
return;
}
// 判断读取成功否
if ( !m_Image.m_lpData )
{
// 失败,可能非BMP格式
CString strMsg;
strMsg = L"读取图像时出错!可能是不支持该类型的图像文件!";
// 提示出错
MessageBox ( NULL, strMsg, L"系统提示",
MB_ICONINFORMATION | MB_OK );
// 返回
return;
}
Init(); //对图像的尺寸和调色板信息进行初始化
// 初始化脏标记为FALSE
SetModifiedFlag ( FALSE );
// 刷新
UpdateAllViews ( NULL );
// 恢复光标形状
EndWaitCursor();
// 返回
return;
}
示例3: EndWaitCursor
void CAcctHierDlg::OnOrgPpkgscomp()
{
m_iBuildComponents = TRUE;
m_rbEquipView.SetCheck( DISABLE );
m_rbListView.SetCheck( DISABLE );
m_rbPpkgsView.SetCheck( DISABLE );
m_rbPpkgsComp.SetCheck( ENABLE );
m_rbAlaCarteView.SetCheck( DISABLE );
/* CAMqa83432,83195*/
int nCountPpkgscomp;
int nCountAcct;
int nCountPpkgs;
if (galHierCountAcctSelection(m_hAPI,
m_iHierId,
&nCountAcct,
&m_lpError ) == GAL_FAILURE )
{
EndWaitCursor();
CGuiMsg::GuiMessage(GUIMSG_ERROR_COUNTING_ACCOUNT);
return;
}
if (galHierCountPkgSelection(m_hAPI,
m_iHierId,
&nCountPpkgs,
&m_lpError ) == GAL_FAILURE )
{
EndWaitCursor();
CGuiMsg::GuiMessage(GUIMSG_ERROR_COUNTING_PACKAGE);
return;
}
if (galHierCountPkgCompSelection(m_hAPI,
m_iHierId,
&nCountPpkgscomp,
&m_lpError ) == GAL_FAILURE )
{
EndWaitCursor();
CGuiMsg::GuiMessage(GUIMSG_ERROR_COUNTING_PACKAGE_COMPONENTS);
return;
}
m_iMaxAlaProducts = nCountAcct + nCountPpkgs+ nCountPpkgscomp + 1;
DeleteObjects();
BuildAcct();
BuildPkgs();
m_iBuildComponents = FALSE;
}
示例4: BeginWaitCursor
// The following example illustrates the most common case
// of displaying the hourglass cursor during some lengthy
// processing of a command handler implemented in some
// CCmdTarget-derived class, such as a document or view.
void CMyView::OnBeginSleepEnd()
{
BeginWaitCursor(); // display the hourglass cursor
// do some lengthy processing
Sleep(3000);
EndWaitCursor(); // remove the hourglass cursor
}
示例5: dlgOpen
void CMainWizard::OnScImportSettings(void)
{
CString strFilter;
CString strTitle;
CProcessPrivileges processPrivileges;
enum { fdwFlags = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST };
strFilter.LoadString(IDS_SETTINGS_FILTER);
#if (_MFC_VER < 0x0700)
CFileDialogEx dlgOpen(TRUE, _T("hive"), AfxGetAppName(), fdwFlags, strFilter);
#else
CFileDialog dlgOpen(TRUE, _T("hive"), AfxGetAppName(), fdwFlags, strFilter);
#endif // _MFC_VER
strTitle.LoadString(IDS_TITLE_IMPORT);
dlgOpen.m_ofn.lpstrTitle = strTitle;
if (dlgOpen.DoModal() == IDOK)
{
BeginWaitCursor();
CWinApp* pApp = AfxGetApp();
ASSERT_VALID(pApp);
processPrivileges[SE_RESTORE_NAME] = SE_PRIVILEGE_ENABLED;
HKEY hAppKey = pApp->GetAppRegistryKey();
::RegRestoreKey(hAppKey, dlgOpen.GetPathName(), REG_FORCE_RESTORE);
::RegCloseKey(hAppKey);
processPrivileges[SE_RESTORE_NAME] = 0;
EndWaitCursor();
}
}
示例6: dlgSaveAs
void CMainWizard::OnScExportSettings(void)
{
CString strFilter;
CString strTitle;
CProcessPrivileges processPrivileges;
enum { fdwFlags = OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY };
strFilter.LoadString(IDS_SETTINGS_FILTER);
#if (_MFC_VER < 0x0700)
CFileDialogEx dlgSaveAs(FALSE, _T("hive"), AfxGetAppName(), fdwFlags, strFilter);
#else
CFileDialog dlgSaveAs(FALSE, _T("hive"), AfxGetAppName(), fdwFlags, strFilter);
#endif // _MFC_VER
strTitle.LoadString(IDS_TITLE_EXPORT);
dlgSaveAs.m_ofn.lpstrTitle = strTitle;
if (dlgSaveAs.DoModal() == IDOK)
{
BeginWaitCursor();
CWinApp* pApp = AfxGetApp();
ASSERT_VALID(pApp);
processPrivileges[SE_BACKUP_NAME] = SE_PRIVILEGE_ENABLED;
HKEY hAppKey = pApp->GetAppRegistryKey();
::RegSaveKey(hAppKey, dlgSaveAs.GetPathName(), NULL);
::RegCloseKey(hAppKey);
processPrivileges[SE_BACKUP_NAME] = 0;
EndWaitCursor();
}
}
示例7: ASSERT
void CTypeLibTreeView::OnTreeItemExpanding(NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = 0 ;
NM_TREEVIEW* pnmtv = (NM_TREEVIEW*)pNMHDR;
if ((pnmtv->action != TVE_EXPAND && pnmtv->itemNew.lParam) ||
(pnmtv->itemNew.state & TVIS_EXPANDEDONCE))
return ;
CTreeItem* pItem = (CTreeItem*)pnmtv->itemNew.lParam ;
if (pItem == NULL)
return ;
ASSERT(pItem->IsKindOf(RUNTIME_CLASS(CTreeItem)));
BeginWaitCursor() ;
m_tree.SetRedraw( FALSE ) ;
*pResult = !pItem->Expand( pnmtv->itemNew.hItem ) ;
// No children
if (*pResult == TRUE)
{
TV_ITEM item ;
item.cChildren = 0 ;
item.mask = TVIF_CHILDREN ;
item.hItem = pnmtv->itemNew.hItem ;
m_tree.SetItem( &item ) ;
}
m_tree.SetRedraw( TRUE ) ;
EndWaitCursor() ;
}
示例8: GetDocument
void CIMDisplayView::OnCrop()
{
CIMDisplayDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
SetupUndo();
BeginWaitCursor();
try {
CRect trackRect;
m_tracker.GetTrueRect(trackRect);
Geometry newGeo( trackRect.Width(), trackRect.Height(), trackRect.left, trackRect.top );
pDoc->GetImage().crop( newGeo );
}
catch(Exception e)
{
DoDisplayError("OnCrop",e.what());
}
EndWaitCursor();
UpdateTheView();
}
示例9: BeginWaitCursor
void CDibView::OnEditPaste()
{
HDIB hNewDIB = NULL;
if (OpenClipboard())
{
BeginWaitCursor();
hNewDIB = (HDIB) CopyHandle(::GetClipboardData(CF_DIB));
CloseClipboard();
if (hNewDIB != NULL)
{
CDibDoc* pDoc = GetDocument();
pDoc->ReplaceHDIB(hNewDIB); // and free the old DIB
pDoc->InitDIBData(); // set up new size & palette
pDoc->SetModifiedFlag(TRUE);
SetScrollSizes(MM_TEXT, pDoc->GetDocSize());
OnDoRealize((WPARAM)m_hWnd,0); // realize the new palette
pDoc->UpdateAllViews(NULL);
}
EndWaitCursor();
}
}
示例10: BeginWaitCursor
void NewVersionDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
int iTotalTextLength = ctlDetails.GetWindowTextLength();
ctlDetails.SetSel(iTotalTextLength, iTotalTextLength);
BeginWaitCursor();
CString sResult;
CWebAccess webAccess;
webAccess.Get("www.milow.net/site/projects/parnrar/pnrVersions.xml", sResult);
if (sResult != "")
{
MSXML::IXMLDOMDocumentPtr domVersions;
if (CoCreateInstance( MSXML::CLSID_DOMDocument, 0, CLSCTX_INPROC_SERVER, MSXML::IID_IXMLDOMDocument, (void**)&domVersions ) != S_OK)
{
ctlDetails.ReplaceSel("Error: Failed to create DOMDocument object");
goto CLEANUP;
}
domVersions->loadXML(sResult.GetBuffer(0));
CString sXml = static_cast<char *>(domVersions->xml);
if (sXml == "")
{
ctlDetails.ReplaceSel("Error: Failed to download version information");
goto CLEANUP;
}
MSXML::IXMLDOMElementPtr eVer = domVersions->selectSingleNode("/Versions/Version");
CString sVer = static_cast<char *>(_bstr_t(eVer->getAttribute("number")));
if (sVer == theApp.GetMyVersion())
{
ctlDetails.ReplaceSel("You are currently running the latest version of Par-N-Rar");
goto CLEANUP;
}
//Get all info about later versions
CString sText = "You are currently running v" + theApp.GetMyVersion();
sText += "\n";
sText += "The latest version is v" + sVer;
sText += "\n\n";
MSXML::IXMLDOMNodeListPtr nlVersions = domVersions->selectNodes( "/Versions/Version");
for (long l=0; l<nlVersions->length; l++)
{
eVer = nlVersions->Getitem(l);
sVer = static_cast<char *>(_bstr_t(eVer->getAttribute("number")));
if (sVer == theApp.GetMyVersion())
break;
sText += "****************************************************\nVersion " + sVer;
sText += ": \n";
sText += static_cast<char *>(eVer->text);
sText += "\n\n";
}
ctlDetails.ReplaceSel(sText);
}
CLEANUP:
Resize();
EndWaitCursor();
}
示例11: BeginWaitCursor
BOOL CCertRemoveSelectDlg::RefreshCertificateList()
/*++
Routine Description:
Refresh certificate list view from internal license list.
Arguments:
None.
Return Values:
BOOL.
--*/
{
BeginWaitCursor();
BOOL ok = ::LvRefreshObArray( &m_listCertificates, &g_removeColumnInfo, &m_licenseArray );
EndWaitCursor();
return ok;
}
示例12: BeginWaitCursor
void CRepositoryBrowser::Refresh()
{
BeginWaitCursor();
if (m_nExternalOvl >= 0)
SYS_IMAGE_LIST().SetOverlayImage(m_nExternalOvl, OVERLAY_EXTERNAL);
m_RepoTree.DeleteAllItems();
m_RepoList.DeleteAllItems();
m_TreeRoot.m_ShadowTree.clear();
m_TreeRoot.m_sName = "";
m_TreeRoot.m_bFolder = true;
TVINSERTSTRUCT tvinsert = {0};
tvinsert.hParent = TVI_ROOT;
tvinsert.hInsertAfter = TVI_ROOT;
tvinsert.itemex.mask = TVIF_DI_SETITEM | TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
tvinsert.itemex.pszText = L"/";
tvinsert.itemex.lParam = (LPARAM)&m_TreeRoot;
tvinsert.itemex.iImage = m_nIconFolder;
tvinsert.itemex.iSelectedImage = m_nOpenIconFolder;
m_TreeRoot.m_hTree= m_RepoTree.InsertItem(&tvinsert);
ReadTree(&m_TreeRoot);
m_RepoTree.Expand(m_TreeRoot.m_hTree, TVE_EXPAND);
FillListCtrlForShadowTree(&m_TreeRoot);
m_RepoTree.SelectItem(m_TreeRoot.m_hTree);
EndWaitCursor();
}
示例13: BeginWaitCursor
void CDlg::OnBnClickedButton5()
{
//Товар-склад
COleVariant vC;
short i;
BeginWaitCursor();
HMODULE hMod;
BOOL bFndC;
CString strFndC;
bFndC = FALSE;
strFndC = _T("");
if(IsEnableRec(ptrRs1)){
i = 0;
vC = GetValueRec(ptrRs1,i);
vC.ChangeType(VT_BSTR);
strFndC = vC.bstrVal;
strFndC.TrimLeft();
strFndC.TrimRight();
bFndC = TRUE;
}
hMod=AfxLoadLibrary(_T("OrdStrg.dll"));
typedef BOOL (*pDialog)(CString,_ConnectionPtr,CString,BOOL);
pDialog func=(pDialog)GetProcAddress(hMod,"startOrdStrg");
(func)(m_strNT, ptrCnn,strFndC,bFndC);
// m_SlpDay.SetDate(t1);
AfxFreeLibrary(hMod);
EndWaitCursor();
}
示例14: BeginWaitCursor
void CVideoWnd::CreateTransparent(LPCTSTR pTitle, RECT rect, HBITMAP BitmapID)
{
CTransparentWnd::CreateTransparent( pTitle, rect, BitmapID);
BeginWaitCursor();
//FrameGrabber
if (!m_FrameGrabber.GetSafeHwnd())
{
//m_FrameGrabber.Create(0,9,this);
int ret = m_FrameGrabber.Create(0,9,this);
//ret = 0;
if (ret)
{
double delayPeriod = 1000 / m_iRefreshRate;
//SetTimer(0x1, DEFAULT_PERIOD, NULL);
SetTimer(0x1, (int) delayPeriod, NULL);
m_iStatus = 1;
}
else {
m_textstring.LoadString(IDS_STRING_NOWEBCAM);
}
}
EndWaitCursor();
}
示例15: catch
void CLoginDlg::DispLatestUser()
{
try
{
if( m_SQLDirect.ExecuteSQL("SELECT * FROM uSysInfo")==SQL_SUCCESS)
{
int nRet=m_SQLDirect.Fetch();
if(!nRet)
{
m_strUser=m_SQLDirect.GetCol(1);
CWnd* pWnd;
pWnd=GetDlgItem(IDC_EDT_PWD); //IDC_EDT_USER IDC_EDT_PWD
pWnd->SetFocus();
}
else
{
CWnd* pWnd;
pWnd=GetDlgItem(IDC_EDT_USER);
pWnd->SetFocus();
}
}
}
catch(CDBException *e){
e->ReportError();
EndWaitCursor();
return ;
}
}