Example #1
0
void CDConsoleDlg::OnNMRClickListDcusers(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
	// TODO: Add your control notification handler code here
	*pResult = 0;

	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	*pResult = 0;
	int nItem = pNMListView->iItem;
	if (-1 == nItem)
	{
		return;
	}

	//弹出菜单
	CMenu menu;
	menu.CreatePopupMenu();
	menu.AppendMenu(MF_STRING, ID_MENU_DCUSERINFO, _T("Info"));
	CString sUserType = m_DcUsers.GetItemText(nItem, DCUSERS_CATEGORY);

	if (sUserType == _T("9"))
	{
		CMenu gisMenu;
		gisMenu.CreatePopupMenu();//
		gisMenu.AppendMenu(MF_STRING, ID_MENU_DCGISSUBSCRIBE, _T("Sub"));
		gisMenu.AppendMenu(MF_STRING, ID_MENU_DCGISUNSUBSCRIBE, _T("UnSub"));
		menu.AppendMenu(MF_POPUP, (UINT)gisMenu.m_hMenu, _T("GIS"));
	}

	CPoint pmenu;
	::GetCursorPos(&pmenu);
	menu.TrackPopupMenu(0, pmenu.x, pmenu.y, this);
}
Example #2
0
BOOL CCardInfDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// 将“关于...”菜单项添加到系统菜单中。

	// IDM_ABOUTBOX 必须在系统命令范围内。
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		BOOL bNameValid;
		CString strAboutMenu;
		bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
		ASSERT(bNameValid);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// 设置此对话框的图标。  当应用程序主窗口不是对话框时,框架将自动
	//  执行此操作
	SetIcon(m_hIcon, TRUE);			// 设置大图标
	SetIcon(m_hIcon, FALSE);		// 设置小图标

	ShowWindow(SW_MINIMIZE);

	// TODO: 在此添加额外的初始化代码

	return TRUE;  // 除非将焦点设置到控件,否则返回 TRUE
}
Example #3
0
///////////////////////////////////////////////////////////////////////////////
// OnInitDialog
BOOL CXZipTestDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Add "About..." menu item to system menu.

	// IDM_ABOUTBOX must be in the system command range.
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	m_List.SetContextMenuId(IDR_XLISTBOX);
	m_List.AddLine(CXListBox::Blue, CXListBox::White, _T("XZipTest v1.3"));
	m_List.AddLine(CXListBox::Blue, CXListBox::White, _T(""));

	return TRUE;  // return TRUE  unless you set the focus to a control
}
Example #4
0
void CHello2Dlg::OnLbnDblclkList4()
{
	// TODO: 在此添加控件通知处理程序代码
  CMenu   mainmenu;    
  mainmenu.LoadMenu(IDR_SELPROBE);

  CMenu *pM = mainmenu.GetSubMenu(0);
  //remove the existing menu
  CString   str ;  
  int i;
  for(i=pM->GetMenuItemCount()-1;i>=0;i--)   //取得菜单的项数。  
  {    
          pM->GetMenuString(i,str,MF_BYPOSITION);    
          //将指定菜单项的标签拷贝到指定的缓冲区。MF_BYPOSITION的解释见上。    
		  pM->DeleteMenu(i,MF_BYPOSITION);   
  }
  pM->AppendMenu(MF_STRING,ID_32771,_T("显示转换结果"));
  pM->AppendMenu(MF_STRING,ID_32771+1,_T("显示原始数据"));
  pM->AppendMenu(MF_STRING,ID_32771+2,_T("删除选中数据"));
  pM->AppendMenu(MF_STRING,ID_32771+3,_T("清空所有数据"));
  pM->AppendMenu(MF_STRING,ID_32771+4,_T("导出所有数据"));
  m_cmdbase = ID_32773;

  CRect rect;
  m_chlist.GetClientRect(&rect);
  
  CPoint pt;
  GetCursorPos(&pt);

    pM->TrackPopupMenu(TPM_LEFTALIGN,pt.x,pt.y,this);
	return;

}
BOOL CTestHttpDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Add "About..." menu item to system menu.

	// IDM_ABOUTBOX must be in the system command range.
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	// TODO: Add extra initialization here
	m_ctrlProgress.ShowWindow(SW_HIDE);
	return TRUE;  // return TRUE  unless you set the focus to a control
}
Example #6
0
BOOL CEzShortcutDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// 시스템 메뉴에 "정보..." 메뉴 항목을 추가합니다.

	// IDM_ABOUTBOX는 시스템 명령 범위에 있어야 합니다.
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// 이 대화 상자의 아이콘을 설정합니다. 응용 프로그램의 주 창이 대화 상자가 아닐 경우에는
	// 프레임워크가 이 작업을 자동으로 수행합니다.
	SetIcon(m_hIcon, TRUE);			// 큰 아이콘을 설정합니다.
	SetIcon(m_hIcon, FALSE);		// 작은 아이콘을 설정합니다.

	CoInitialize(NULL);

	LoadShortCutList();
	return TRUE;  // 컨트롤에 대한 포커스를 설정하지 않을 경우 TRUE를 반환합니다.
}
VOID CDeskIconManager::MouseRClick(int nX,int nY)
{
	//个性化
	//rundll32.exe shell32.dll,Control_RunDLL desk.cpl,1,2
	
	HMODULE hShellMod = LoadLibrary(L"shell32.dll");

	if (hShellMod)
	{
		typedef void ( WINAPI *TypeRunDll32FunW)(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow);

		TypeRunDll32FunW pFun = (TypeRunDll32FunW)::GetProcAddress(hShellMod,"Control_RunDLLW");
		if (pFun)
		{
			pFun(m_wndShow,NULL,L"desk.cpl,1,2",SW_SHOW);
		}
	}


 	CMenu Menu;
 	Menu.CreatePopupMenu();
 	Menu.AppendMenu(MF_STRING,0,L"刷新(&E)");
	Menu.AppendMenu(MF_STRING,0,L"个性化(&R)");
	//Menu.AppendMenu(MF_STRING,0,L"个性化(&R)");
 	::TrackPopupMenu(Menu.m_hMenu,TPM_LEFTALIGN|TPM_TOPALIGN,nX,nY,0,m_wndShow,NULL);
	
}
Example #8
0
    void ColorMapGridControl::OnRButtonDown(UINT nFlags, CPoint point)
    {
        CGridCellIndices currCell = GetCellIndices(point);
        int currRow = currCell.m_nRow - 1;
        int currCol = currCell.m_nCol - 1;
        if ((currRow < 0) && (currCol < 0))
            return;

        m_nCurrRow = currRow;
        if (m_nCurrRow < 0)
            m_nCurrRow = 0;

        CMenu popMenu;
        popMenu.CreatePopupMenu();

        int nRows = gColorMap.ncolorMap;

        UINT rowInsFlags = MF_STRING;
        if ((currRow < 0) || (currRow > nRows) || (nRows == DC_ColorMap::maxCMcolors))
            rowInsFlags |= MF_GRAYED;

        UINT clipFlags = MF_STRING;
        if (!IsDataInClipboard()) {
            clipFlags |= MF_GRAYED;
        }

        VERIFY(popMenu.AppendMenu(rowInsFlags, WM_INSERT_ROW_BEFORE,  "Insert Row Before" ));
        VERIFY(popMenu.AppendMenu(rowInsFlags, WM_INSERT_ROW_AFTER,   "Insert Row After" ));
        VERIFY(popMenu.AppendMenu(rowInsFlags, WM_DELETE_ROW,         "Delete Row" ));
        VERIFY(popMenu.AppendMenu(clipFlags, WM_COPYFROMCLIPBOARD, "Copy From Clipboard"));

        ClientToScreen(&point);
        popMenu.TrackPopupMenu(TPM_LEFTBUTTON|TPM_RIGHTBUTTON, point.x, point.y, this);
    }
Example #9
0
void CPlayWnd::OnContextMenu(CWnd* pWnd, CPoint point) 
{
	// TODO: Add your message handler code here
	CPtzScreen *pContainer = (CPtzScreen *)GetParent();
	pContainer->SetActivePage(this);

// 	CClientDemoDlg *pMainWnd = (CClientDemoDlg *)(AfxGetApp()->GetMainWnd());
// 	CDialogTransmit * pTransWnd = (CDialogTransmit *)pMainWnd->m_pTabTransmit;

	CMenu menu;
	menu.CreatePopupMenu();
	menu.AppendMenu(MF_STRING | pContainer->GetFullScreen()    ? MF_CHECKED : MF_UNCHECKED, VIDEO_MENU_FULLSCREEN, ConvertString(NAME_MENU_FULLSCREEN));
	menu.AppendMenu(MF_STRING | pContainer->GetMultiScreen()    ? MF_CHECKED : MF_UNCHECKED, 	VIDEO_MENU_MULTISCREEN, ConvertString(NAME_MENU_MULTISCREEN));
	menu.AppendMenu(MF_STRING | pContainer->GetAutoAdjustPos() ? MF_CHECKED : MF_UNCHECKED, VIDEO_MENU_AUTOADJUST, ConvertString(NAME_MENU_AUTOADJUST));
	menu.AppendMenu(MF_STRING | pContainer->m_pGetParams(m_nWndID, 0, pContainer->m_dwGetParams) ? MF_CHECKED : MF_UNCHECKED, VIDEO_MENU_EXITDECODE, ConvertString(NAME_MENU_EXITDECODE));
	menu.AppendMenu(MF_STRING | pContainer->m_pGetParams(m_nWndID, 1, pContainer->m_dwGetParams) ? MF_CHECKED : MF_UNCHECKED, VIDEO_MENU_EXITCYCLE, ConvertString(NAME_MENU_EXITCYCLE));

	TrackPopupMenu( 
		menu.m_hMenu, 
		TPM_LEFTALIGN, 
		point.x, 
		point.y,
		0,
		m_hWnd,
		NULL);
}
Example #10
0
BOOL CKeyBoardDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		//pSysMenu->DeleteMenu(SC_TASKLIST, MF_BYCOMMAND);
		pSysMenu->AppendMenu(MF_SEPARATOR);
		pSysMenu->AppendMenu(MF_STRING, IDM_ENABLE_OFFLINE, "离线记录(&O)");
		pSysMenu->AppendMenu(MF_STRING, IDM_CLEAR_RECORD, "清空记录(&C)");

		if (m_bIsOfflineRecord)
			pSysMenu->CheckMenuItem(IDM_ENABLE_OFFLINE, MF_CHECKED);
	}


	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	m_edit.SetLimitText(MAXDWORD); // 设置最大长度
	ResizeEdit();
	UpdateTitle();
	SendNext();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Example #11
0
BOOL CFileSearchDlg::OnInitDialog()
{
    CDialogEx::OnInitDialog();

    // Add "About..." menu item to system menu.

    // IDM_ABOUTBOX must be in the system command range.
    ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
    ASSERT(IDM_ABOUTBOX < 0xF000);

    CMenu* pSysMenu = GetSystemMenu(FALSE);
    if (pSysMenu != NULL) {
        BOOL bNameValid;
        CString strAboutMenu;
        bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
        ASSERT(bNameValid);
        if (!strAboutMenu.IsEmpty()) {
            pSysMenu->AppendMenu(MF_SEPARATOR);
            pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
        }
    }

    // Set the icon for this dialog.  The framework does this automatically
    //  when the application's main window is not a dialog
    SetIcon(m_hIcon, TRUE);			// Set big icon
    SetIcon(m_hIcon, FALSE);		// Set small icon

    m_DirectoryEdit.SetWindowText(FileSearch::AppCore::Utils::GetAppFolder().c_str());
    m_QueryEdit.SetWindowText(_T("size > 3 and name ==\"test\""));
    return TRUE;  // return TRUE  unless you set the focus to a control
}
Example #12
0
BOOL CIPNotFound::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// 将“关于...”菜单项添加到系统菜单中。

	// IDM_ABOUTBOX 必须在系统命令范围内。
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		BOOL bNameValid;
		CString strAboutMenu;
		bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
		ASSERT(bNameValid);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
	//  执行此操作
	SetIcon(m_hIcon, TRUE);			// 设置大图标
	SetIcon(m_hIcon, FALSE);		// 设置小图标

	// TODO: 在此添加额外的初始化代码
	/*m_ipOfPartner = ntohl(inet_addr("0.0.0.1"));
	UpdateData(false);*/
	return TRUE;  // 除非将焦点设置到控件,否则返回 TRUE
}
Example #13
0
CMenu *
PortPopup::MidiMenu(bool isInput)
{
	CMenu	*menu = new CMenu;
	menu->CreatePopupMenu();
	short n_p = environment.quaMidi.countPorts();
	for (short i=0; i<n_p; i++) {
		QuaMidiPort *p = environment.quaMidi.port(i);
		if (	(isInput && (p->mode & QUA_PORT_IN)) ||
				(!isInput && (p->mode & QUA_PORT_OUT))) {
			CMenu	*chmenu = new CMenu;
			chmenu->CreatePopupMenu();
			if (isInput) {
				for (short j=1; j<=16; j++) {
					string buf = "Ch " + to_string(j);
					chmenu->AppendMenu(MF_STRING, MenuIndexItem(p, j, isInput), buf.c_str());
				}
			} else {
				for (short j=1; j<=16; j++) {
					string buf = "Ch " + to_string(j);
					chmenu->AppendMenu(MF_STRING, MenuIndexItem(p, j, isInput), buf.c_str());
				}
			}
			menu->AppendMenu(MF_POPUP, (UINT) chmenu->m_hMenu, p->name(NMFMT_NAME));
		}
	}
	return menu;
}
Example #14
0
CMenu *
PortPopup::AudioMenu(bool isInput, short nch)
{
	CMenu	*menu = new CMenu;
	menu->CreatePopupMenu();
	short n_p = environment.quaAudio.countPorts();
	for (short i=0; i<n_p; i++) {
		QuaAudioPort *p = environment.quaAudio.port(i);
		CMenu	*chmenu = new CMenu;
		chmenu->CreatePopupMenu();
		if (isInput) {
			short n_c = p->NInputs();
			for (short j=0; (j+nch-1)<n_c; j+=nch) {
				chmenu->AppendMenu(MF_STRING, MenuIndexItem(p, j, isInput), p->InputName(j).c_str());
			}
		} else {
			short n_c = p->NOutputs();
			for (short j=0; (j+nch-1)<n_c; j+=nch) {
				chmenu->AppendMenu(MF_STRING, MenuIndexItem(p, j, isInput), p->OutputName(j).c_str());
			}
		}
		menu->AppendMenu(MF_POPUP, (UINT) chmenu->m_hMenu, p->name(NMFMT_NAME));
	}
	return menu;
}
BOOL NewControlsPropSheet::OnInitDialog() {
  BOOL bResult = CMFCPropertySheet::OnInitDialog();

  // Add "About..." menu item to system menu.

  // IDM_ABOUTBOX must be in the system command range.
  ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
  ASSERT(IDM_ABOUTBOX < 0xF000);

  CMenu* pSysMenu = GetSystemMenu(FALSE);
  if (pSysMenu != NULL) {
    CString strAboutMenu;
    strAboutMenu.LoadString(IDS_ABOUTBOX);
    if (!strAboutMenu.IsEmpty()) {
      pSysMenu->AppendMenu(MF_SEPARATOR);
      pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
    }
  }

  // Set the icon for this dialog.  The framework does this automatically
  //  when the application's main window is not a dialog
  SetIcon(m_hIcon, TRUE); // Set big icon
  SetIcon(m_hIcon, FALSE); // Set small icon

  return bResult;
}
Example #16
0
void CMainFrame::BuildViewList()
{
	WinGPAC *app = GetApp();
	if (!app->m_isopen) return;

	/*THIS IS HARCODED FROM THE MENU LAYOUT */
	CMenu *pMenu = GetMenu()->GetSubMenu(1)->GetSubMenu(0);
	while (pMenu->GetMenuItemCount()) pMenu->DeleteMenu(0, MF_BYPOSITION);

	s32 id = ID_VP_0;
	nb_viewpoints = 0;
	while (1) {
		const char *szName;
		Bool bound;
		M4Err e = M4T_GetViewpoint(app->m_term, nb_viewpoints+1, &szName, &bound);
		if (e) break;
		if (szName) {
			pMenu->AppendMenu(MF_ENABLED, id+nb_viewpoints, szName);
		} else {
			char szLabel[1024];
			sprintf(szLabel, "Viewpoint #%d", nb_viewpoints+1);
			pMenu->AppendMenu(MF_ENABLED, id+nb_viewpoints, szLabel);
		}
		nb_viewpoints++;
		if (nb_viewpoints==ID_VP_19-ID_VP_0) break;
	}
}
Example #17
0
BOOL CCCFixDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Add "About..." menu item to system menu.

	// IDM_ABOUTBOX must be in the system command range.
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

    // Set up static link
    m_oMicrosoftLink.SubclassDlgItem(IDC_MICROSOFT_LINK,this);
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}
Example #18
0
BOOL CKeyBoardDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		//pSysMenu->DeleteMenu(SC_TASKLIST, MF_BYCOMMAND);
		pSysMenu->AppendMenu(MF_SEPARATOR);
		pSysMenu->AppendMenu(MF_STRING, IDM_CLEAR_RECORD, "清空记录(&C)");
		pSysMenu->AppendMenu(MF_STRING, IDM_SAVE_RECORD, "保存记录(&S)");
	}


	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	m_edit.SetLimitText(MAXDWORD); // 设置最大长度
	ResizeEdit();
	UpdateTitle();

	// 通知远程控制端对话框已经打开
	BYTE bToken = COMMAND_NEXT;
	m_iocpServer->Send(m_pContext, &bToken, sizeof(BYTE));

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Example #19
0
BOOL CVideoDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		pSysMenu->AppendMenu(MF_STRING, IDM_ENABLECOMPRESS, "视频压缩(&C)");
		pSysMenu->AppendMenu(MF_STRING, IDM_SAVEAVI, "保存录像(&V)");
		pSysMenu->AppendMenu(MF_SEPARATOR);	
	
		CString str;
	
		str.Format("\\\\%s %d * %d", m_IPAddress, m_lpbmi->bmiHeader.biWidth, m_lpbmi->bmiHeader.biHeight);
	
		SetWindowText(str);


	
		InitMMI();

	
		m_hDD = DrawDibOpen();
	
		m_hDC = ::GetDC(m_hWnd);


		BYTE bToken = COMMAND_NEXT;
	
		m_iocpServer->Send(m_pContext, &bToken, sizeof(BYTE));
	}
	
		return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
Example #20
0
int CDrawQuoteTabCtrl::OpenAllMarketMenu(CPoint point )
{
	CDrawQuoteTab* pTab = m_ayItem[m_nCurItem];
	CString strCurItemName = pTab->m_strName;
	CArray<StockType> ayAllMarket;
	m_pDataSource->HSDataSourceEx_GetSystemMarketInfo(0, 0, ayAllMarket);

	short nPreMarket = 0;
	CMenu menu;
	menu.CreatePopupMenu();
	for (int i=0; i<ayAllMarket.GetCount(); i++)
	{
		if ((nPreMarket&0xFF00) != (ayAllMarket.GetAt(i).m_nStockType&0xFF00))
		{
			menu.AppendMenu(MF_SEPARATOR|MF_MENUBARBREAK);
		}
		menu.AppendMenu(MF_BYCOMMAND,CDRAWTAB_ID_MENU_MARKET_BEGIN+i,ayAllMarket.GetAt(i).m_stTypeName.m_szName);
		if (!strCurItemName.IsEmpty() && strCurItemName==ayAllMarket.GetAt(i).m_stTypeName.m_szName)
		{
			menu.CheckMenuItem(CDRAWTAB_ID_MENU_MARKET_BEGIN+i,MF_BYCOMMAND|MF_CHECKED);
		}

		CString strTemp;
		strTemp.Format("%s-%d",ayAllMarket.GetAt(i).m_stTypeName.m_szName,ayAllMarket.GetAt(i).m_nStockType);
		m_mapTempMenuIndex.SetAt(CDRAWTAB_ID_MENU_MARKET_BEGIN+i,strTemp);

		nPreMarket = (ayAllMarket.GetAt(i).m_nStockType&0xFF00);
	}

	CWnd* pWnd = m_pDrawTabNotify->TabGetCWnd();
	int nMenuID = menu.TrackPopupMenu(TPM_VERPOSANIMATION | TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD,point.x,point.y,pWnd);
	menu.DestroyMenu();
	return nMenuID;
}
Example #21
0
void CHello2Dlg::OnStnDblclickRunGraph()
{
	// TODO: 在此添加控件通知处理程序代码
  CMenu   mainmenu;    
  mainmenu.LoadMenu(IDR_SELPROBE);
  m_graph.Invalidate();
  CMenu *pM = mainmenu.GetSubMenu(0);
  //remove the existing menu
  CString   str ;  
  int i;
  for(i=pM->GetMenuItemCount()-1;i>=0;i--)   //取得菜单的项数。  
  {    
          pM->GetMenuString(i,str,MF_BYPOSITION);    
          //将指定菜单项的标签拷贝到指定的缓冲区。MF_BYPOSITION的解释见上。    
		  pM->DeleteMenu(i,MF_BYPOSITION);   
  }
  pM->AppendMenu(MF_STRING,ID_32771,_T("关闭辅助显示"));
  for(i=0;i<sizeof(m_ridlgs)/sizeof(CRunitemDialog*);i++){
		CString name;
		name.Format(_T("同时显示通道%i"),i+1);
  		pM->AppendMenu(MF_STRING,ID_32771+1+i,name);
  }
  m_cmdbase = ID_32772;

  
  CPoint pt;
  GetCursorPos(&pt);
	SetForegroundWindow();
    pM->TrackPopupMenu(TPM_LEFTALIGN,pt.x,pt.y,this);
	return;
/*  CString tt;
  tt.Format(_T("clicked:%i,%i"),pt.x,pt.y);
  GetDlgItem(IDC_MAIN_STATUS)->SetWindowText(tt);
*/
}
Example #22
0
void CGameManageDlg::OnNMRclickList4(NMHDR *pNMHDR, LRESULT *pResult)
{
	// TODO: 在此添加控件通知处理程序代码

	//m_GameUeserListCtrl.Getse

	CMenu PopMenu;
	CString strMenu;
	PopMenu.CreatePopupMenu();
	CPoint Point;
	GetCursorPos(&Point);
	m_GameUeserListCtrl.ScreenToClient(&Point);
	m_ListIndex2 = m_GameUeserListCtrl.HitTest(Point);
	if (0 <= m_ListIndex2 && m_ListIndex2 < m_wSocket.m_UserManage.GetOnLineUserCount())
	{
		 PopMenu.AppendMenu(0, MSG_CMD_GM_ACT_NO_TALK, TEXT("禁止聊天"));
		 PopMenu.AppendMenu(0, MSG_CMD_GM_ACT_KICK_OUT, TEXT("踢出房间"));
		 PopMenu.AppendMenu(0, MSG_CMD_GM_ACT_BANDON_ID, TEXT("禁止登录"));
		 PopMenu.AppendMenu(0, MSG_CMD_CM_START_CHAT, TEXT("发起聊天"));
		 PopMenu.AppendMenu(0,  MSG_CMD_GM_ACT_AWORD, TEXT("奖励"));
		 //显示菜单

		 GetCursorPos(&Point);
		 PopMenu.TrackPopupMenu(TPM_RIGHTBUTTON, Point.x, Point.y, this);
		 PopMenu.DestroyMenu();
	}

	*pResult = 0;
}
Example #23
0
BOOL DlgOtherAlgo::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// 将“关于...”菜单项添加到系统菜单中。

	// IDM_ABOUTBOX 必须在系统命令范围内。
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		BOOL bNameValid;
		CString strAboutMenu;
		bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
		ASSERT(bNameValid);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}
	m_combo_algo.AddString(_T("Apriori"));
	SetIcon(m_hIcon, TRUE);			// 设置大图标
	SetIcon(m_hIcon, FALSE);		// 设置小图标
	return TRUE;  		
}
Example #24
0
void CDConsoleDlg::OnRclickTreePatchgroups(NMHDR *pNMHDR, LRESULT *pResult)
{
	// TODO: Add your control notification handler code here
	*pResult = 0;
	CPoint pt, pmenu;
	::GetCursorPos(&pt);
	::GetCursorPos(&pmenu);
	m_PatchGroups.ScreenToClient(&pt);

	UINT uFlag = 0;
	HTREEITEM hSelectedItem = m_PatchGroups.HitTest(pt,&uFlag);
	if (NULL == hSelectedItem || !(TVHT_ONITEM & uFlag))
	{
		return;
	}

	m_PatchGroups.SelectItem(hSelectedItem);
	if (m_PatchGroups.GetParentItem(hSelectedItem) == NULL)
	{
		GroupInfo* pInfo = (GroupInfo*)m_PatchGroups.GetItemData(hSelectedItem);

		//组节点
		CMenu menu;
		menu.CreatePopupMenu();
		//menu.AppendMenu(MF_STRING, ID_MENU_SUBGROUP, _T("SubscribeGroup"));
		menu.AppendMenu(MF_STRING, ID_MENU_GETPATCHGROUPINFO, _T("GetPatchGroupInfo"));
		menu.AppendMenu(MF_STRING, ID_MENU_ADDPATCHROUPMEMBER, _T("AddMember"));
		menu.AppendMenu(MF_STRING, ID_MENU_DELPATCHROUPMEMBER, _T("DelMember"));
		menu.AppendMenu(MF_STRING, ID_MENU_SUB_JOIN_DCGROUP, _T("SubJoinGroup"));
		menu.AppendMenu(MF_STRING, ID_MENU_UNSUB_DCGROUP, _T("UnSubscribeGroup"));
		menu.AppendMenu(MF_STRING, ID_MENU_RMPATCHROUP, _T("RemovePatchGroup"));

		menu.TrackPopupMenu(0, pmenu.x, pmenu.y, this);
	}
}
Example #25
0
void CKeyControl::OnRButtonDown(UINT nFlags, CPoint point) 
{
	CMenu rbMenu;
	rbMenu.CreatePopupMenu();

	CLinkListNode<KEY> *pNode = PtInKey(point);
	
	if (pNode)
	{
		rbMenu.AppendMenu(MF_STRING, 5000, "&Edit Key");
		if ((pNode->m_pPrev) && (pNode->m_pNext))
		{
			rbMenu.AppendMenu(MF_SEPARATOR, 5001, "");
			rbMenu.AppendMenu(MF_STRING, 5002, "&Delete Key");
		}
		
		m_pMenuKey = pNode;			

		ClientToScreen(&point);
		rbMenu.TrackPopupMenu(TPM_LEFTALIGN, point.x, point.y, this);
	}

	
	CStatic::OnRButtonDown(nFlags, point);
}
Example #26
0
BOOL COpenSubDlg::OnInitDialog()
  {
   CDialog::OnInitDialog();
   // Add "About..." menu item to system menu.

   // IDM_ABOUTBOX must be in the system command range.
   ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
   ASSERT(IDM_ABOUTBOX < 0xF000);

   CMenu* pSysMenu = GetSystemMenu(FALSE);
   if (pSysMenu != NULL)
   {
      BOOL bNameValid;
      CString strAboutMenu;
      bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
      ASSERT(bNameValid);
      if (!strAboutMenu.IsEmpty())
      {
         pSysMenu->AppendMenu(MF_SEPARATOR);
         pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
      }
   }
   // Set the icon for this dialog.  The framework does this automatically
   //  when the application's main window is not a dialog
   SetIcon(m_hIcon, TRUE);         // Set big icon
   SetIcon(m_hIcon, FALSE);      // Set small icon
//--- set dialog title
   std::wstring path(theApp.m_lpCmdLine);
   SetWindowText(path.substr(path.rfind(L'\\') + 1).c_str());
//--- create list columns
   InitializeList();
   EnableButtons(FALSE);
   PrintMessage(GetSafeHwnd(), L"Searching");
   return(TRUE);
  }
Example #27
0
BOOL CPDImfcDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

    // Add "About..." menu item to system menu.

    // IDM_ABOUTBOX must be in the system command range.
    ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
    ASSERT(IDM_ABOUTBOX < 0xF000);

    CMenu* pSysMenu = GetSystemMenu(FALSE);
    if (pSysMenu != NULL)
    {
        CString strAboutMenu;
        strAboutMenu.LoadString(IDS_ABOUTBOX);
        if (!strAboutMenu.IsEmpty())
        {
            pSysMenu->AppendMenu(MF_SEPARATOR);
            pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
        }
    }

    // Set the icon for this dialog.  The framework does this automatically
    //  when the application's main window is not a dialog
    SetIcon(m_hIcon, TRUE);			// Set big icon
    SetIcon(m_hIcon, FALSE);		// Set small icon

    m_font.CreateStockObject(ANSI_FIXED_FONT); //default
    m_edtOutput.SetFont(&m_font);

    return TRUE;  // return TRUE  unless you set the focus to a control
}
Example #28
0
void DataCaptureGridCtrl::OnRButtonDown(UINT nFlags, CPoint point)
{
  CGridCellIndices currCell = GetCellIndices(point);
  int currRow = currCell.m_nRow;
  if ((currRow <= 0) || (currRow > dataCaptureData.Size()))
    return;

  m_currDCap = currRow - 1;

  CMenu popMenu;
  popMenu.CreatePopupMenu();

  UINT insFlags = MF_STRING;
  if (dataCaptureData.IsNotValid(m_currDCap))
    insFlags = MF_STRING | MF_GRAYED;

  VERIFY(popMenu.AppendMenu(insFlags, WM_DCAPM_INS_BEFORE,  "Insert Before" ));
  VERIFY(popMenu.AppendMenu(insFlags, WM_DCAPM_INS_AFTER, "Insert After" ));
  VERIFY(popMenu.AppendMenu(insFlags, WM_DCAPM_DUPLICATE, "Duplicate" ));
  VERIFY(popMenu.AppendMenu(MF_STRING, WM_DCAPM_DELETE, "Delete" ));

  ClientToScreen(&point);
  popMenu.TrackPopupMenu( TPM_LEFTBUTTON|TPM_RIGHTBUTTON, point.x, point.y, this );

}
Example #29
0
void CServerDlg::DefaultInit()
{
    // Add "About..." menu item to system menu.

    // IDM_ABOUTBOX must be in the system command range.
    ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
    ASSERT(IDM_ABOUTBOX < 0xF000);

    CMenu* pSysMenu = GetSystemMenu(FALSE);
    if (pSysMenu != NULL)
    {
        CString strAboutMenu;
        strAboutMenu.LoadString(IDS_ABOUTBOX);
        if (!strAboutMenu.IsEmpty())
        {
            pSysMenu->AppendMenu(MF_SEPARATOR);
            pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
        }
    }

    // Set the icon for this dialog.  The framework does this automatically
    //  when the application's main window is not a dialog
    SetIcon(m_hIcon, TRUE);			// Set big icon
    SetIcon(m_hIcon, FALSE);		// Set small icon
}
Example #30
0
BOOL ListDlgSheet::OnInitDialog()
{
	BOOL bResult = CPropertySheet::OnInitDialog();

	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		BOOL bNameValid;
		CString strAboutMenu;
		bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
		ASSERT(bNameValid);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	return bResult;
}