You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
2.6 KiB
105 lines
2.6 KiB
//****************************************************************************
|
|
//
|
|
// Copyright (c) 1994, Microsoft Corporation
|
|
//
|
|
// File: BUSY.CPP
|
|
//
|
|
// Implementation file for the CBusy class.
|
|
//
|
|
// History:
|
|
//
|
|
// Scott V. Walker, SEA 6/30/94 Created.
|
|
//
|
|
//****************************************************************************
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "portable.h"
|
|
|
|
#include "busy.h"
|
|
|
|
//****************************************************************************
|
|
//
|
|
// CBusy::CBusy
|
|
//
|
|
//****************************************************************************
|
|
CBusy::CBusy(CWnd *pParentWnd, LPCTSTR pszText)
|
|
{
|
|
SetBusy(pParentWnd, pszText);
|
|
}
|
|
|
|
//****************************************************************************
|
|
//
|
|
// CBusy::CBusy
|
|
//
|
|
//****************************************************************************
|
|
CBusy::CBusy(CWnd *pParentWnd, UINT nID)
|
|
{
|
|
CString sText;
|
|
|
|
sText.LoadString(nID);
|
|
SetBusy(pParentWnd, sText);
|
|
}
|
|
|
|
//****************************************************************************
|
|
//
|
|
// CBusy::CBusy
|
|
//
|
|
//****************************************************************************
|
|
CBusy::CBusy(CWnd *pParentWnd)
|
|
{
|
|
SetBusy(pParentWnd, _T(""));
|
|
}
|
|
|
|
//****************************************************************************
|
|
//
|
|
// CBusy::CBusy
|
|
//
|
|
//****************************************************************************
|
|
CBusy::CBusy()
|
|
{
|
|
SetBusy(NULL, _T(""));
|
|
}
|
|
|
|
//****************************************************************************
|
|
//
|
|
// CBusy::SetBusy
|
|
//
|
|
//****************************************************************************
|
|
void CBusy::SetBusy(CWnd *pParentWnd, LPCTSTR pszText)
|
|
{
|
|
m_pParentWnd = pParentWnd;
|
|
|
|
m_hOldCursor = ::SetCursor(::LoadCursor(NULL, IDC_WAIT));
|
|
|
|
if (m_pParentWnd != NULL)
|
|
{
|
|
TCHAR szOldText[255];
|
|
|
|
// Retrieve the current text and save it 'til later.
|
|
szOldText[0] = '\0';
|
|
m_pParentWnd->SendMessage(WM_BUSY_GETTEXT, 255, (LPARAM)szOldText);
|
|
m_sOldText = szOldText;
|
|
|
|
if (pszText == NULL)
|
|
pszText = _T("");
|
|
|
|
m_pParentWnd->SendMessage(WM_BUSY_SETTEXT, 0, (LPARAM)pszText);
|
|
}
|
|
}
|
|
|
|
//****************************************************************************
|
|
//
|
|
// CBusy::~CBusy
|
|
//
|
|
//****************************************************************************
|
|
CBusy::~CBusy()
|
|
{
|
|
::SetCursor(m_hOldCursor);
|
|
|
|
if (m_pParentWnd != NULL)
|
|
{
|
|
m_pParentWnd->SendMessage(WM_BUSY_SETTEXT, 0,
|
|
(LPARAM)(LPCTSTR)m_sOldText);
|
|
}
|
|
}
|