gusucode.com > VC++模仿超炫Vista风格QQ界面-源码程序 > VC++模仿超炫Vista风格QQ界面/BeautyQQ/UserInfoDlg.cpp
// UserInfoDlg.cpp : implementation file // #include "stdafx.h" #include "BeautyQQ.h" #include "UserInfoDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CUserInfoDlg dialog CUserInfoDlg::CUserInfoDlg(CWnd* pParent /*=NULL*/) : CDialog(CUserInfoDlg::IDD, pParent) { //{{AFX_DATA_INIT(CUserInfoDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CUserInfoDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CUserInfoDlg) DDX_Control(pDX, IDC_BUTTON_USER_NAME, m_BottonCtrlName); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CUserInfoDlg, CDialog) //{{AFX_MSG_MAP(CUserInfoDlg) ON_BN_CLICKED(IDC_BUTTON_USER_NAME, OnButtonUserName) ON_WM_SIZE() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CUserInfoDlg message handlers void CUserInfoDlg::OnButtonUserName() { CMenu menu; menu.CreatePopupMenu(); menu.InsertMenu(0, MF_BYPOSITION , ID_MENU_NEW_MEMBER, _T("连机(C)")); menu.InsertMenu(1, MF_BYPOSITION|MF_SEPARATOR); menu.InsertMenu(2, MF_BYPOSITION , ID_MENU_NEW_MEMBER, _T("忙碌(B)")); menu.InsertMenu(2, MF_BYPOSITION , ID_MENU_NEW_MEMBER, _T("马上回来(I)")); menu.InsertMenu(4, MF_BYPOSITION , ID_MENU_NEW_MEMBER, _T("离开(O)")); menu.InsertMenu(5, MF_BYPOSITION , ID_MENU_NEW_MEMBER, _T("外出就餐(L)")); menu.InsertMenu(6, MF_BYPOSITION|MF_SEPARATOR); CRect rtRect; m_BottonCtrlName.GetWindowRect(rtRect); menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, rtRect.left, rtRect.bottom, AfxGetMainWnd()); } void CUserInfoDlg::OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy); // Invalidate(TRUE); }