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

📄 ctrlpan.cpp

📁 VC++环境下的GPS全球定位系统源代码
💻 CPP
字号:
// CtrlPan.cpp
// Source for CControlPanel

#include "stdafx.h"
#include "ctrlpan.h"

// static data
CControlPanel* CControlPanel::m_pThis = NULL;

CControlPanel::CControlPanel()
{
  // Set up the static object pointer
  m_pThis = this;
}

CControlPanel::~CControlPanel()
{
}

//////////////////////////////////////////////////////////////////////////////              
// Callback function (exported)

// static member functions (callbacks)
LONG APIENTRY CControlPanel::CPlApplet(HWND hwndCPl, UINT  uMsg,
                                       LONG lParam1, LONG lParam2)
{
  // Get a pointer to the C++ object
  CControlPanel* pCtrl = m_pThis;
  ASSERT(pCtrl);

  switch (uMsg) 
  {
    case CPL_DBLCLK:     return pCtrl->OnDblclk(hwndCPl, lParam1, lParam2);
    case CPL_EXIT:       return pCtrl->OnExit();
    case CPL_GETCOUNT:   return pCtrl->OnGetCount();
    case CPL_INIT:       return pCtrl->OnInit();
    case CPL_NEWINQUIRE: return pCtrl->OnInquire(lParam1, (NEWCPLINFO*)lParam2);
    case CPL_INQUIRE:    return 0; // not handled
    case CPL_SELECT:     return pCtrl->OnSelect(lParam1, lParam2);
    case CPL_STOP:       return pCtrl->OnStop(lParam1, lParam2);
    default:             break;
  }

  return 1; // not processed
}

/////////////////////////////////////////////////////////////////////////////////////////
// Default command handlers

LONG CControlPanel::OnDblclk(HWND /*hwndCPl*/, UINT /*uAppNum*/, LONG /*lData*/) 
{
  // Show the dialog
  return 0; // OK
}

LONG CControlPanel::OnExit()
{
  return 0; // OK
}

LONG CControlPanel::OnGetCount()
{
  return 1; // default is support for one dialog box
}

LONG CControlPanel::OnInit()
{
  return 1; // OK
}

LONG CControlPanel::OnInquire(UINT /*uAppNum*/, NEWCPLINFO* pInfo) 
{
  // Fill in the data
  pInfo->dwSize = sizeof(NEWCPLINFO); // important
  pInfo->dwFlags = 0;
  pInfo->dwHelpContext = 0;
  pInfo->lData = 0;
  pInfo->hIcon = ::LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(1));
  _tcscpy(pInfo->szName, _T("Applet"));
  _tcscpy(pInfo->szInfo, _T("Raw Cpl Applet"));
  _tcscpy(pInfo->szHelpFile, _T(""));
  return 0; // OK (don't send CPL_INQUIRE msg)
}

LONG CControlPanel::OnSelect(UINT /*uAppNum*/, LONG /*lData*/) 
{
  return 1; // not handled
}

LONG CControlPanel::OnStop(UINT /*uAppNum*/, LONG /*lData*/) 
{
  return 1; // not handled
}

⌨️ 快捷键说明

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