⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 busy.cpp

📁 windows的snmp api源码
💻 CPP
字号:
//****************************************************************************
//
//  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);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -