当前位置: 首页>>代码示例>>C++>>正文


C++ OnCommand函数代码示例

本文整理汇总了C++中OnCommand函数的典型用法代码示例。如果您正苦于以下问题:C++ OnCommand函数的具体用法?C++ OnCommand怎么用?C++ OnCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了OnCommand函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

/**
 * @brief Handle dialog messages.
 * @param [in] hDlg Handle to the dialog.
 * @param [in] iMsg The message.
 * @param [in] wParam The command in the message.
 * @param [in] lParam The optional parameter for the command.
 * @return TRUE if the message was handled, FALSE otherwise.
 */
INT_PTR EncodeDecodeDialog::DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
	switch (iMsg)
	{
	case WM_INITDIALOG:
		return OnInitDialog(hDlg);

	case WM_COMMAND:
		return OnCommand(hDlg, wParam, lParam);
	}
	return FALSE;
}
开发者ID:alistairmcmillan,项目名称:frhed,代码行数:20,代码来源:EncodeDlg.cpp

示例2: switch

LRESULT CAppWindow::WndProc(UINT uMessage, WPARAM wParam, LPARAM lParam)
{
	switch (uMessage)
	{
	case WM_CREATE:
		return OnCreate();

	case WM_NOTIFTICON:
		return OnNotifyIcon((UINT)lParam, (UINT)wParam);

	case WM_COMMAND:
		return OnCommand(LOWORD(wParam));

	case WM_WAVE_CONNECTION_STATE:
		return OnWaveConnectionState((WAVE_CONNECTION_STATE)wParam, lParam);

	case WM_TIMER:
		m_lpTimers->Process((UINT_PTR)wParam);
		return 0;

	case WM_DESTROY:
		m_lpNotifyIcon->Destroy();
		return 0;

	case WM_CURL_RESPONSE:
		return OnCurlResponse((CURL_RESPONSE)wParam, lParam);

	case WM_VERSION_STATE:
		return OnVersionState((VERSION_STATE)wParam);

	case WM_CLOSE:
		return OnClose();

	case WM_WTSSESSION_CHANGE:
		return OnWTSSessionChange(wParam);

	case WM_POWERBROADCAST:
		return OnPowerBroadcast(wParam);

	case WM_ENDSESSION:
		return OnEndSession((BOOL)wParam, lParam);

	default:
		if (uMessage == CNotifierApp::Instance()->GetWmTaskbarCreated())
		{
			m_lpNotifyIcon->Recreate();
			return 0;
		}
		break;
	}

	return CWindow::WndProc(uMessage, wParam, lParam);
}
开发者ID:pvginkel,项目名称:wave-notify,代码行数:53,代码来源:CAppWindow.cpp

示例3: if

// Extend event processing to call OnCommand
bool wxPropertyFormView::ProcessEvent(wxEvent& event)
{
    if (wxEvtHandler::ProcessEvent(event))
        return true;
    else if (event.IsCommandEvent() && !event.IsKindOf(CLASSINFO(wxUpdateUIEvent)) && event.GetEventObject())
    {
        OnCommand(* ((wxWindow*) event.GetEventObject()), (wxCommandEvent&) event);
        return true;
    }
    else
        return false;
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:13,代码来源:propform.cpp

示例4: OnNmDblClkActionlist

void CPPgScheduler::OnNmDblClkActionlist(NMHDR* /*pNMHDR*/, LRESULT* pResult)
{
	if (m_actions.GetSelectionMark()!=-1) {
		int ac=m_actions.GetItemData(m_actions.GetSelectionMark());
		// Mighty Knife: actions without parameters
		if (ac < ACTION_BACKUP || ac > ACTION_RELOAD) {
			if (ac!=6 && ac!=7) OnCommand(MP_CAT_EDIT,0);
		} 
		// [end] Mighty Knife
	}

	*pResult = 0;
}
开发者ID:rusingineer,项目名称:StulleMule,代码行数:13,代码来源:PPgScheduler.cpp

示例5: switch

INT_PTR DialogAbout::TabSkins::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
	case WM_COMMAND:
		return OnCommand(wParam, lParam);

	case WM_NOTIFY:
		return OnNotify(wParam, lParam);
	}

	return FALSE;
}
开发者ID:AlonTzarafi,项目名称:rainmeter,代码行数:13,代码来源:DialogAbout.cpp

示例6: switch

INT_PTR CConfigDlg::WndProc(UINT a_uMsg, WPARAM a_wParam, LPARAM a_lParam)
{
    switch (a_uMsg)
    {
    case WM_COMMAND:
        return OnCommand(HIWORD(a_wParam), LOWORD(a_wParam), (HWND)a_lParam) ;

    case WM_INITDIALOG:
        return OnInitDialog() ;
    }
    
    return FALSE ;
}
开发者ID:hackshields,项目名称:antivirus,代码行数:13,代码来源:ConfigDlg.cpp

示例7: switch

	LRESULT CWin::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
	{
		LRESULT lRes = 0;
		BOOL bHandled = TRUE;
		switch (uMsg)
		{
		case WM_CREATE:			lRes = OnCreate(uMsg, wParam, lParam, bHandled); break;
		case WM_CLOSE:			lRes = OnClose(uMsg, wParam, lParam, bHandled); break;
		case WM_DESTROY:		lRes = OnDestroy(uMsg, wParam, lParam, bHandled); break;
#if defined(WIN32) && !defined(UNDER_CE)
		//case WM_NCCREATE:		lRes = OnNcCreate(uMsg, wParam, lParam, bHandled); break;
		case WM_NCMOUSEMOVE:    lRes = OnNCMouseMove(uMsg, wParam, lParam, bHandled); break;
		case WM_NCMOUSELEAVE:   lRes = OnNCMouseLeave(uMsg, wParam, lParam, bHandled); break;
		case WM_NCACTIVATE:		lRes = OnNcActivate(uMsg, wParam, lParam, bHandled); break;
		case WM_NCCALCSIZE:		lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled); break;
		case WM_NCPAINT:		lRes = OnNcPaint(uMsg, wParam, lParam, bHandled); break;
		case WM_NCHITTEST:		lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled); break;
		case WM_GETMINMAXINFO:	lRes = OnGetMinMaxInfo(uMsg, wParam, lParam, bHandled); break;
		case WM_MOUSEWHEEL:		lRes = OnMouseWheel(uMsg, wParam, lParam, bHandled); break;
#endif
		case WM_ERASEBKGND:     lRes = OnEraseBkGnd(uMsg, wParam, lParam, bHandled); break;
		case WM_SIZE:			lRes = OnSize(uMsg, wParam, lParam, bHandled); break;
		case WM_CHAR:		    lRes = OnChar(uMsg, wParam, lParam, bHandled); break;
		case WM_SYSCOMMAND:		lRes = OnSysCommand(uMsg, wParam, lParam, bHandled); break;
		case WM_KEYDOWN:		lRes = OnKeyDown(uMsg, wParam, lParam, bHandled); break;
		case WM_KILLFOCUS:		lRes = OnKillFocus(uMsg, wParam, lParam, bHandled); break;
		case WM_SETFOCUS:		lRes = OnSetFocus(uMsg, wParam, lParam, bHandled); break;
		case WM_LBUTTONUP:		lRes = OnLButtonUp(uMsg, wParam, lParam, bHandled); break;
		case WM_LBUTTONDOWN:	lRes = OnLButtonDown(uMsg, wParam, lParam, bHandled); break;
		case WM_MOUSEMOVE:		lRes = OnMouseMove(uMsg, wParam, lParam, bHandled); break;
		case WM_MOUSELEAVE:     lRes = OnMouseLeave(uMsg, wParam, lParam, bHandled); break;
		case WM_MOUSEHOVER:	    lRes = OnMouseHover(uMsg, wParam, lParam, bHandled); break;
		case WM_HOTKEY:			lRes = OnHotKey(uMsg, wParam, lParam, bHandled); break;
//		case WM_TIMER:			lRes = OnTimer(uMsg, wParam, lParam, bHandled); break;//OnTimer响应有小问题
		case WM_MOVING:			lRes = OnMoving(uMsg, wParam, lParam, bHandled); break;
		case WM_SIZING:			lRes = OnSizing(uMsg, wParam, lParam, bHandled); break;
		case WM_SHOWWINDOW:		lRes = OnShowWindow(uMsg, wParam, lParam, bHandled); break;
		case WM_COMMAND:		lRes = OnCommand(uMsg, wParam, lParam, bHandled); break;
//		case WM_PAINT:			lRes = OnPaint(uMsg, wParam, lParam, bHandled); break;//OnPaint响应有问题
		case WM_MENUCOMMAND:    lRes = OnMenuCommand(uMsg, wParam, lParam, bHandled); break;
		default:				bHandled = FALSE; break;
		}
		if (bHandled) return lRes;

		lRes = ProcessWindowMessage(uMsg, wParam, lParam, bHandled);
		if (bHandled) return lRes;

		if(_paintManager && _paintManager->MessageHandler(uMsg,wParam,lParam,lRes))
			return lRes;
		return __super::HandleMessage(uMsg,wParam,lParam);
	}
开发者ID:uvbs,项目名称:myduilib,代码行数:51,代码来源:Window.cpp

示例8: switch

/// <summary>
/// Dispatch the message to the handler function
/// </summary>
/// <param name="hWnd">The handle to the window which receives the message</param>
/// <param name="uMsg">The message identifier</param>
/// <param name="wParam">The additional message information</param>
/// <param name="lParam">The additional message information</param>
/// <returns>If the message has been processed by handler function, TRUE is returned. Otherwise FALSE is returned and the message is handled by default dialog procedure</returns>
LRESULT KinectWindow::DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg)
    {
    case WM_STREAMEVENT:
        UpdateStreams();
        break;

    case WM_TIMEREVENT:
        UpdateTimedStreams();
        break;

    case WM_INITDIALOG:
        NuiViewer::SetIcon(hWnd);
        break;

    case WM_SIZE:
        OnResize();
        break;

    case WM_COMMAND:
        OnCommand(wParam);
        break;

    case WM_NOTIFY:
        OnNotify(lParam);
        break;

    case WM_CLOSE:
        OnClose(hWnd, wParam);
        break;

    case WM_DESTROY:
        PostQuitMessage(0);
        break;

    case WM_SHOWKINECTWINDOW:
        {
            if (0 != wParam)
            {
                ShowWindows();
            }
        }
        break;

    default:
        break;
    }

    return FALSE;
}
开发者ID:rikvdbrule,项目名称:KinectRecording,代码行数:59,代码来源:KinectWindow.cpp

示例9: switch

LRESULT cBiomeViewWnd::WndProc(HWND a_Wnd, UINT a_Msg, WPARAM wParam, LPARAM lParam)
{
	switch (a_Msg)
	{
		case WM_CLOSE:       return OnClose();
		case WM_COMMAND:     return OnCommand(wParam, lParam);
		case WM_LBUTTONDOWN: return OnLButtonDown(wParam, lParam);
		case WM_LBUTTONUP:   return OnLButtonUp  (wParam, lParam);
		case WM_MOUSEMOVE:   return OnMouseMove  (wParam, lParam);
		case WM_PAINT:       return OnPaint();
		case WM_TIMER:       return OnTimer(wParam);
	}
	return ::DefWindowProc(a_Wnd, a_Msg, wParam, lParam);
}
开发者ID:Hillvith,项目名称:MCServer,代码行数:14,代码来源:BiomeViewWnd.cpp

示例10: WndProc

//窗口处理函数
LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, 
						 WPARAM wParam, LPARAM lParam )
{
	switch( msg )
	{
	case WM_COMMAND:
		OnCommand( hWnd, wParam );
		break;
	case WM_DESTROY:
		PostQuitMessage( 0 );
		break;
	}
	return DefWindowProc( hWnd, msg, wParam, lParam );
}
开发者ID:zxwbj,项目名称:danei,代码行数:15,代码来源:WinDlg.cpp

示例11: switch

/**
 * @brief Handle dialog messages.
 * @param [in] hDlg Handle to the dialog.
 * @param [in] iMsg The message.
 * @param [in] wParam The command in the message.
 * @param [in] lParam The optional parameter for the command.
 * @return TRUE if the message was handled, FALSE otherwise.
 */
INT_PTR CopyHexdumpDlg::DlgProc(HWindow *pDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
	switch (iMsg)
	{
	case WM_INITDIALOG:
		return OnInitDialog(pDlg);
	case WM_COMMAND:
		return OnCommand(pDlg, wParam, lParam);
	case WM_HELP:
		OnHelp(pDlg);
		break;
	}
	return FALSE;
}
开发者ID:derekdreery,项目名称:frhed,代码行数:22,代码来源:CopyHexdumpDlg.cpp

示例12: SetWindowLongPtr

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 窗口被创建
VOID CChildWnd::OnCreate()
{
	const TBBUTTON TBB_Button[] =
	{
		{0,		0,						0,					TBSTYLE_SEP,		0,	0},
		{0,		IDM_File_Open,			TBSTATE_ENABLED,	TBSTYLE_BUTTON,		0,	0},
		{1,		IDM_File_Export,		TBSTATE_ENABLED,	TBSTYLE_BUTTON,		0,	0},
		{0,		0,						TBSTATE_ENABLED,	TBSTYLE_SEP,		0,	0},
		{2,		IDM_Play_Play,			TBSTATE_ENABLED,	TBSTYLE_CHECK,		0,	0},
		{0,		0,						0,					TBSTYLE_SEP,		0,	0},
		{3,		IDM_Play_GotoStart,		TBSTATE_ENABLED,	TBSTYLE_BUTTON,		0,	0},
		{4,		IDM_Play_StepBackward,	TBSTATE_ENABLED,	TBSTYLE_BUTTON,		0,	0},
		{5,		IDM_Play_StepForward,	TBSTATE_ENABLED,	TBSTYLE_BUTTON,		0,	0},
		{6,		IDM_Play_GotoEnd,		TBSTATE_ENABLED,	TBSTYLE_BUTTON,		0,	0},
		{0,		0,						0,					TBSTYLE_SEP,		0,	0},
	};

	// 记录 this 指针
	SetWindowLongPtr(m_hWnd, GWLP_USERDATA, (LONG_PTR) this);

	// 创建并初始化状态栏
	m_hStatusBar = CreateStatusWindow(WS_CHILD | WS_VISIBLE, NULL, m_hWnd, IDC_StatusBar);
	m_hEditBox = CreateWindowEx(0, TEXT("EDIT"), NULL, WS_CHILD | ES_UPPERCASE, 
		0, 0, 0, 0, m_hStatusBar, (HMENU) IDC_EditBox, g_hInst, (PVOID) this);
	SendMessage(m_hEditBox, WM_SETFONT, (WPARAM) SendMessage(m_hStatusBar, WM_GETFONT, 0, 0), 0);
	SetWindowLongPtr(m_hEditBox, GWLP_USERDATA, (LONG_PTR) SetWindowLongPtr(m_hEditBox, GWLP_WNDPROC, (LONG_PTR) EditBoxProc));
	AdjustStatusBar();

	// 设置状态栏
	SetStatusText(LNG_Ready);
	OnCommand(IDC_RawVideo_Change);

	// 创建工具栏
	m_hToolbar = CUtility::CreateToolbar(WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT,
		m_hWnd, MAKEINTRESOURCE(IDB_Toolbar), m_hImageLists, _NumOf(TBB_Button), TBB_Button);

	// 创建并设置定位栏
	m_hSeekBar = CreateWindowEx(0, TRACKBAR_CLASS, NULL, 
		WS_CHILD | WS_VISIBLE | TBS_HORZ,
		0, 0, 0, 0, m_hToolbar, (HMENU) IDC_SeekBar, g_hInst, NULL);
	SendMessage(m_hSeekBar, TBM_SETTICFREQ, 1, 0);
	SendMessage(m_hSeekBar, TBM_SETRANGE, TRUE, MAKELONG(0, m_uTotalFrame - 1));
	SendMessage(m_hSeekBar, TBM_SETPAGESIZE, 0, (m_uTotalFrame + 9) / 10);
	SetWindowLongPtr(m_hToolbar, GWLP_USERDATA, (LONG_PTR) SetWindowLongPtr(m_hToolbar, GWLP_WNDPROC, (LONG_PTR) ToolbarWndProc));

	// 创建播放窗口
	m_hPlayWnd = CreateWindowEx(WS_EX_CLIENTEDGE, STR_AppName TEXT("PlayWnd"), STR_AppName TEXT("PlayWnd"), WS_CHILD | WS_VISIBLE, 
		0, 0, 0, 0, m_hWnd, (HMENU) IDC_PlayWnd, g_hInst, (PVOID) this);
	SetWindowLongPtr(m_hPlayWnd, GWLP_USERDATA, (LONG_PTR) this);
}
开发者ID:Yonsm,项目名称:RawPlayer,代码行数:52,代码来源:ChildWnd.cpp

示例13: switch

GMessage::Result GWindow::OnEvent(GMessage *Msg)
{
	switch (MsgCode(Msg))
	{
		case B_SIMPLE_DATA:
		{
			GArray<char*> Files;
			int32 Count = 0;
			type_code Type = 0;
			
			if (Msg->GetInfo("refs", &Type, &Count) == B_OK)
			{
				for (int i=0; i<Count; i++)
				{
					entry_ref Ref;
					if (Msg->FindRef("refs", i, &Ref) == B_OK)
					{
						BPath Path("");
						BEntry Entry(&Ref, true);
						Entry.GetPath(&Path);
						char *p = (char*) Path.Path();
						if (p)
						{
							Files.Add(NewStr(p));
						}
					}
				}
			}
			
			if (Files.Length() > 0)
			{
				OnReceiveFiles(Files);
			}
			
			Files.DeleteArrays();
			break;
		}
		case M_COMMAND:
		{
			int32 Cmd = 0;
			int32 Event = 0;
			Msg->FindInt32("Cmd", &Cmd);
			Msg->FindInt32("Event", &Event);
			OnCommand(Cmd, Event, 0);
			break;
		}
	}

	return GView::OnEvent(Msg);
}
开发者ID:FEI17N,项目名称:Lgi,代码行数:50,代码来源:GWindow.cpp

示例14: switch

//------------------------------------------------------------------------
BOOL	CEGForm::OnMessage( HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam )
{
	switch( uMsg )
	{

	case	WM_NOTIFY:
		{
			CEGBaseWnd	*	pWnd = GetWndObject( ((NMHDR*)lParam)->hwndFrom );
			if( pWnd != NULL )
			{
				pWnd->OnNotify( (NMHDR*)lParam );
			}
		}
		break;
	case	WM_DRAWITEM:
		{
			LPDRAWITEMSTRUCT		pDrawItemStruct = (LPDRAWITEMSTRUCT)lParam;
			UINT	id = (UINT)wParam;
			CEGBaseWnd * pWnd = GetWndObject( pDrawItemStruct->hwndItem );
			if( pWnd != NULL )
			{
				return pWnd->OnDrawItem( pDrawItemStruct );
			}
		}
		break;
	case	WM_SHOWWINDOW:
		{
			OnShow();
		}
		break;
	case	WM_CLOSE:
		{
			if( !OnClose() )
			{
				m_hResult = 0;
				return TRUE;
			}
			PostQuitMessage(0);
			return FALSE;
		}
		break;
	case	WM_COMMAND:
		{
			OnCommand( LOWORD(wParam) );
		}
		break;
	}
	return FALSE;
}
开发者ID:duzhi5368,项目名称:FKSimpleServer,代码行数:50,代码来源:Form.cpp

示例15: switch

int CPreferencesDlg::WindowProc(UINT message, WPARAM waParam, LPARAM laParam)
{
	bool biTraite = TRUE;

	switch (message)
	{
	case WM_ERASEBKGND:			// Fout la merde avec le thême XP...
	case WM_CTLCOLORBTN:
	case WM_CTLCOLORSTATIC:		return FALSE;
	case WM_COMMAND:			OnCommand(waParam, laParam);			break;
	case WM_HELP:				OnHelpContext((LPHELPINFO) laParam);	break;
	default:					biTraite = false;						break;
	}
	return (biTraite ? biTraite : CEasyPHPDialogBase::WindowProc(message, waParam, laParam));
}
开发者ID:TheTypoMaster,项目名称:instantrails,代码行数:15,代码来源:Preferences.cpp


注:本文中的OnCommand函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。