Example #1
0
/**
 * @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;
}
Example #2
0
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);
}
Example #3
0
// 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;
}
Example #4
0
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;
}
Example #5
0
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;
}
Example #6
0
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 ;
}
Example #7
0
	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);
	}
Example #8
0
static BOOL CALLBACK DlgProcedure(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
		case WM_INITDIALOG:
		{
			return OnInitDialog(hWnd);
/*
#pragma warning (push)
#pragma warning (disable : 4311 4312 )
			DefaultMessageEditWindowProc = (WNDPROC) SetWindowLongPtr(hOutputEdit,GWLP_WNDPROC,(LONG)&MessageEditWindowProc);
#pragma warning (pop)
			bool threadSuccess = StartThread(outputProc, (LPVOID)lParam, "outputProc");
			if (!threadSuccess)
			{
				err(TEXT("Error: could not create outputProc thread!"));
			}
*/
		}

		case WM_COMMAND:
		{
			OnCommand(hWnd, (int) LOWORD(wParam), (int) HIWORD(wParam));
			break;
		}

		case WM_SIZE:
		{
			OnSize(hWnd, (int) LOWORD(lParam), (int) HIWORD(lParam));
			break;
		}

		case WM_CONTEXTMENU:
		{
			OnContextMenu(hWnd, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), (HWND) wParam);
			break;
		}

		case WM_CLOSE:
		{
			OnClose(hWnd);
			g_Options->showConsoleDlg = s_bConsoleVisible;
			break;
		}

		case WM_CTLCOLORLISTBOX:
			return (UINT_PTR) OnCtlColorListbox(hWnd, (HWND) lParam, (HDC) wParam);

	}
	return FALSE;
}
/// <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;
}
Example #10
0
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);
}
Example #11
0
//窗口处理函数
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 );
}
Example #12
0
/**
 * @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;
}
Example #13
0
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 窗口被创建
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);
}
Example #14
0
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);
}
Example #15
0
//------------------------------------------------------------------------
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;
}
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));
}
Example #17
0
/**
 * @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 MoveCopyDlg::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);

	case WM_HELP:
		OnHelp(hDlg);
		break;
	}
	return FALSE;
}
Example #18
0
LRESULT CDangleWindowHex::DangleProc(UINT Msg,WPARAM wParam,LPARAM lParam)
{
	//выбор по сообщению
	switch(Msg)
	{
	case WM_KEYDOWN:
		return OnKey(wParam),0;
	case WM_COMMAND:
		return OnCommand(LOWORD(wParam),HIWORD(wParam),(HWND)lParam),0;
	case WM_MOUSEWHEEL:
		return OnMouseWheel(GET_WHEEL_DELTA_WPARAM(wParam)/WHEEL_DELTA,GET_KEYSTATE_WPARAM(wParam)),0;
	default:
		return DefWindowProc(mhWindow,Msg,wParam,lParam);
	}
}
void CGeneralAgentTcpSocket::OnRawData(const char *buf,size_t len)
{
    m_tOnData = time(NULL);
    __fline;
    printf("CGeneralAgentTcpSocket::OnRawData:%ul\n", len);

    dumpBuffer(stdout
               , (unsigned char *)buf, len,
               SHOW_ASCII | SHOW_BINAR | SHOW_HEXAD | SHOW_LINER);

    //////////
    //有数据就调用, 另一种方式
    OnCommand((char *)buf, (unsigned int)len);
    ///////////
}
Example #20
0
LRESULT CLogicView::Reaction(UINT message, WPARAM wParam, LPARAM lParam){
	switch(message){

	case WM_RBUTTONDOWN:
		{
			return OnRButtonDown(wParam,lParam);
		}
	case WM_COMMAND:
		{
			return OnCommand(wParam,lParam);
		}
	default:
		return CWSTreeView::Reaction(message,wParam,lParam);
	}
}
void GUIConsole::_OnCommand(IObject* obj, void* data)
{
	KeyboardEvent* event = (KeyboardEvent*)(data);
	if (event->press && event->key == KEY_RETURN && Command->GetText().Length()>0)
	{
		core::UTFString str = core::UTFString("> ");
		str+=Command->GetText();
		GUI::StringListItem* item = new GUI::StringListItem(str);
		History->AddItem(item);

		core::string cmd = Command->GetText().GetAsString();
		OnCommand(this, cmd);
		Command->SetText(core::string(""));
	}
}
Example #22
0
LRESULT CBscBblDlg::MyMsgMap(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
    LRESULT lRet = 0;
    WINDOWPOS* pLp = (WINDOWPOS*)lParam;
    //cBscTry
    {
        switch(Msg)
        {
        case WM_INITDIALOG:
            {
                lRet = OnInitDialog();
                break;
            }        
        case WM_COMMAND:
            {
                switch(LOWORD(wParam))
                {
                case IDOK:
                    {
                        lRet = OnOK();
                        break;
                    }                
                case IDCANCEL:
                    {
                        lRet = OnCancel();
                        break;
                    }
                default:
                    {
                        lRet = OnCommand(LOWORD(wParam), HIWORD(wParam), lParam);
                    }
                }
                break;
            }
        default:
            {
                if (m_mapMsgHandlers[Msg])
                    lRet = m_mapMsgHandlers[Msg](wParam, lParam, this);
                break;
            }
        }
    }
    ////cBscCatchLogAndMsg(_T("MyMsgMap(") << (unsigned long const)hWnd << _T(",") << 
    //    (unsigned long const)Msg << _T(",") << (unsigned long const)wParam << _T(",") << 
    //    (unsigned long const)lParam << _T(")"));

    return lRet; //We didn't handle the message, so let windows handle it
}
Example #23
0
LRESULT CALLBACK WndProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp)
{
	switch (msg)
	{
		case WM_CREATE:
			OnCreate(hw);
			return 0;
		case WM_COMMAND:
			OnCommand(hw, LOWORD(wp));
			return 0;
		case WM_DESTROY:
			OnDestroy();
			return 0;
	}
	return DefWindowProc(hw, msg, wp, lp);
}
Example #24
0
/**
 * CWndProc オブジェクトの Windows プロシージャ (WindowProc) が用意されています
 * @param[in] nMsg 処理される Windows メッセージを指定します
 * @param[in] wParam メッセージの処理で使う付加情報を提供します。このパラメータの値はメッセージに依存します
 * @param[in] lParam メッセージの処理で使う付加情報を提供します。このパラメータの値はメッセージに依存します
 * @return メッセージに依存する値を返します
 */
LRESULT CWndProc::WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam)
{
	if (nMsg == WM_COMMAND)
	{
		if (OnCommand(wParam, lParam))
		{
			return 0;
		}
	}
	if (nMsg == WM_NCDESTROY)
	{
		OnNcDestroy(wParam, lParam);
		return 0;
	}
	return DefWindowProc(nMsg, wParam, lParam);
}
Example #25
0
static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    PAINTSTRUCT ps;
    HDC			hdc;

    switch (msg)
    {
	case WM_CREATE:
		ClientResize(hWnd, 1000, 450);

		OnWindowCreate(hWnd);
		break;

    case WM_PAINT:
        hdc = BeginPaint(hWnd, &ps);
		{
			cairo_surface_t *surface = cairo_win32_surface_create(hdc);
            cairo_t *cr = cairo_create(surface);

			cairo_surface_t *shell = cairo_image_surface_create_from_png("../res/smatch-shell.png");

			cairo_set_source_surface(cr, shell, 0, 0);
			cairo_paint(cr);

            cairo_surface_finish(surface);
            // Cleanup.
            cairo_destroy(cr);
            cairo_surface_destroy(surface);
		}
		EndPaint(hWnd, &ps);
        break;

	case WM_COMMAND:
		OnCommand(hWnd, msg, wParam, lParam);
		break;

	case WM_DESTROY:
        PostQuitMessage(0);
        break;

    default:
        return DefWindowProc(hWnd, msg, wParam, lParam);
        break;
    }

    return 0;
}
LRESULT Window::WndProc(HWND hWnd_, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch(message)
    {
    case WM_CREATE:
        hWnd = hWnd_;
        OnCreate();
        break;

    case WM_SIZE:
        {
            OnSize(LOWORD(lParam), HIWORD(lParam), wParam);
        }
        break;

    case WM_COMMAND:
        OnCommand(wParam, lParam);
        break;

    case WM_KEYDOWN:
        OnKeyDown(wParam, lParam);
        return 0;

    case WM_LBUTTONDOWN:
        OnLeftMouseButtonDown(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
        return 0;

    case WM_PAINT:
        {
            PAINTSTRUCT ps;
            BeginPaint(hWnd, &ps);
            OnPaint(ps.hdc);
            EndPaint(hWnd, &ps);
        }
        return 0;

    case WM_CLOSE:
        DestroyWindow(hWnd);
        break;

    case WM_DESTROY:
        OnDestroy();
        break;
    }

    return DefWindowProc(hWnd_, message, wParam, lParam);
}
Example #27
0
LRESULT WINAPI WndProc( HWND hWnd, UINT nMsg,
                        WPARAM wParam, LPARAM lParam )
{
    switch( nMsg )
    {
    case WM_COMMAND:
        OnCommand( hWnd, wParam );
        break;
    case WM_CREATE:
        OnCreate( hWnd );
        break;
    case WM_DESTROY:
        PostQuitMessage( 0 );
        break;
    }
    return DefWindowProc( hWnd, nMsg, wParam, lParam );
}
Example #28
0
static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch(uMsg)
    {
        case WM_INITDIALOG:
            return OnInitDialog(hDlg, lParam);

        case WM_DRAWITEM:
            DrawURLButton(hDlg, (LPDRAWITEMSTRUCT)lParam);
            return FALSE;

        case WM_COMMAND:
            return OnCommand(hDlg, (HWND)lParam, HIWORD(wParam), LOWORD(wParam));
    }

    return FALSE;
}
Example #29
0
//窗口处理函数(处理消息)
LRESULT CALLBACK WndProc( HWND hWnd, UINT msgID,
						 WPARAM wParam, LPARAM lParam )
{
	switch( msgID )
	{
	case WM_SETCURSOR:
		{
//			HCURSOR hRec = LoadCursor( g_hInstance,
//							MAKEINTRESOURCE(IDC_CURSOR1));
//			HCURSOR hBall = LoadCursor( g_hInstance,
//							MAKEINTRESOURCE(IDC_CURSOR2));
			HCURSOR hRec = LoadCursorFromFile(
					"c:/windows/Cursors/dinosau2.ani" );
			HCURSOR hBall = LoadCursorFromFile(
					"c:/windows/Cursors/dinosaur.ani" );
			if( LOWORD(lParam)==HTCLIENT )
			{
				POINT pt = { 0 };
				GetCursorPos( &pt );//屏幕坐标系(光标位置)
				ScreenToClient( hWnd, &pt );//转换坐标
				RECT rc = { 0 };
				GetClientRect(hWnd,&rc);//客户区坐标系(边界信息)
				if( pt.x <= rc.right/2 )
					SetCursor( hBall );
				else
					SetCursor( hRec );				
				return 0;
			}else{
				//什么都不写	
			}			
		}
		break;
	case WM_PAINT:
		OnPaint( hWnd );
		break;
	case WM_COMMAND:
		OnCommand( hWnd, wParam );
		break;
	case WM_DESTROY:
		PostQuitMessage( 0 );//可以使GetMessage返回0??
		break;
	}
	return DefWindowProc( hWnd, msgID, wParam, lParam );
			//给各种消息做默认处理
}
Example #30
0
LRESULT CNotePad::WndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
	PAINTSTRUCT ps;
	HDC hdc;
	BOOL bRet = false;
	switch (message)
	{
	case WM_COMMAND:
		bRet = OnCommand(hWnd, message, wParam, lParam);
		break;
	case WM_PAINT:
		hdc = BeginPaint(hWnd, &ps);
		// TODO: 在此添加任意绘图代码...
		EndPaint(hWnd, &ps);
		break;
	case WM_CREATE:
		bRet = OnCreate(hWnd, message, wParam, lParam);
		break;
	case WM_SIZE:
		bRet = OnSize(hWnd, message, wParam, lParam);
		break;
	case WM_CTLCOLOREDIT:
		{
			/*HDC hEditDC = (HDC)wParam;
			SetTextColor( hEditDC, RGB(0, 0, 0));
			SetBkColor( hEditDC, RGB(255, 255, 255)); 
			return (LRESULT)CreateSolidBrush(RGB(255, 255, 255))*/;
		}
		break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	case WM_NOTIFY:
		{
			if (wParam == CRICH_EDIT)
			{
				bRet = OnMouseMove(hWnd, message, wParam, lParam);
			}
		}
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return bRet;
}