Click here to Skip to main content
15,913,722 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCaret not positioned in Richedit Pin
insanely42016-Oct-02 22:56
insanely42016-Oct-02 22:56 
QuestionHow to share an object on the level of the OS? Pin
Raphael Kindt16-Oct-02 21:41
Raphael Kindt16-Oct-02 21:41 
AnswerRe: How to share an object on the level of the OS? Pin
Paul M Watt16-Oct-02 22:01
mentorPaul M Watt16-Oct-02 22:01 
GeneralRe: How to share an object on the level of the OS? Pin
Raphael Kindt17-Oct-02 1:31
Raphael Kindt17-Oct-02 1:31 
Questionmore than one help file???? Pin
Mistermr16-Oct-02 21:03
Mistermr16-Oct-02 21:03 
AnswerRe: more than one help file???? Pin
Tomasz Sowinski16-Oct-02 23:33
Tomasz Sowinski16-Oct-02 23:33 
GeneralTrackMouseEvent little example Pin
Joan M16-Oct-02 20:20
professionalJoan M16-Oct-02 20:20 
GeneralRe: TrackMouseEvent little example Pin
Paul M Watt16-Oct-02 21:20
mentorPaul M Watt16-Oct-02 21:20 
This is code out of the WTL BitmapButton:

// inside of my message handler
MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
MESSAGE_HANDLER(WM_MOUSELEAVE, OnMouseLeave)

LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
{
	if(::GetCapture() == m_hWnd)
	{
		POINT ptCursor = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
		ClientToScreen(&ptCursor);
		RECT rect;
		GetWindowRect(&rect);
		unsigned int uPressed = ::PtInRect(&rect, ptCursor) ? 1 : 0;
		if(m_isPressed != uPressed)
		{
			m_isPressed = uPressed;
			Invalidate();
			UpdateWindow();
		}
	}
	else if(0 == m_isMouseOver)
	{
		m_isMouseOver = 1;
		Invalidate();
		UpdateWindow();
		StartTrackMouseLeave();
	}
		bHandled = FALSE;
	return 1;
}
LRESULT OnMouseLeave(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	if(1 == m_isMouseOver)
	{
		m_isMouseOver = 0;
		Invalidate();
		UpdateWindow();
	}
	return 0;
}

BOOL StartTrackMouseLeave()
{
	TRACKMOUSEEVENT tme;
	tme.cbSize = sizeof(tme);
	tme.dwFlags = TME_LEAVE;
	tme.hwndTrack = m_hWnd;
	return _TrackMouseEvent(&tme);
}



I hope this helps.



Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

GeneralRe: TrackMouseEvent little example Pin
James R. Twine17-Oct-02 5:34
James R. Twine17-Oct-02 5:34 
QuestionCImageList bug.....or am I just dumb? Pin
Teknofreek16-Oct-02 20:06
Teknofreek16-Oct-02 20:06 
AnswerRe: CImageList bug.....or am I just dumb? Pin
Tomasz Sowinski16-Oct-02 23:31
Tomasz Sowinski16-Oct-02 23:31 
GeneralRe: CImageList bug.....or am I just dumb? Pin
Teknofreek17-Oct-02 10:40
Teknofreek17-Oct-02 10:40 
QuestionHow to detect whether network is available? Pin
Wenrich16-Oct-02 18:36
Wenrich16-Oct-02 18:36 
Generalvectorize a bitmap Pin
bethbyang16-Oct-02 15:34
bethbyang16-Oct-02 15:34 
GeneralRe: vectorize a bitmap Pin
Maximilien16-Oct-02 15:57
Maximilien16-Oct-02 15:57 
GeneralRe: vectorize a bitmap Pin
Anonymous17-Oct-02 16:51
Anonymous17-Oct-02 16:51 
GeneralHeeeeeeeelp: CString and /clr Pin
Doug16-Oct-02 12:50
Doug16-Oct-02 12:50 
GeneralRe: Heeeeeeeelp: CString and /clr Pin
Nish Nishant16-Oct-02 19:24
sitebuilderNish Nishant16-Oct-02 19:24 
QuestionSHAutoComplete() where art thou? Pin
Ravi Bhavnani16-Oct-02 12:15
professionalRavi Bhavnani16-Oct-02 12:15 
AnswerRe: SHAutoComplete() where art thou? Pin
Rene De La Garza16-Oct-02 13:12
Rene De La Garza16-Oct-02 13:12 
AnswerRe: SHAutoComplete() where art thou? Pin
Michael Dunn16-Oct-02 18:40
sitebuilderMichael Dunn16-Oct-02 18:40 
AnswerRe: SHAutoComplete() where art thou? Pin
Ravi Bhavnani17-Oct-02 1:00
professionalRavi Bhavnani17-Oct-02 1:00 
GeneralInline functions performance. Pin
Maximilien16-Oct-02 10:47
Maximilien16-Oct-02 10:47 
GeneralRe: Inline functions performance. Pin
Joaquín M López Muñoz16-Oct-02 11:13
Joaquín M López Muñoz16-Oct-02 11:13 
GeneralRe: Inline functions performance. Pin
Marc Clifton16-Oct-02 11:28
mvaMarc Clifton16-Oct-02 11:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.