Click here to Skip to main content
16,009,647 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionUsing Static Lib For Creating the MFC Controls Pin
lavate malllik23-Jul-08 4:29
lavate malllik23-Jul-08 4:29 
AnswerRe: Using Static Lib For Creating the MFC Controls Pin
Mark Salsbery23-Jul-08 6:30
Mark Salsbery23-Jul-08 6:30 
GeneralRe: Using Static Lib For Creating the MFC Controls Pin
lavate malllik23-Jul-08 18:49
lavate malllik23-Jul-08 18:49 
Questiondecimal separator Pin
jeremie.delaitre23-Jul-08 4:04
jeremie.delaitre23-Jul-08 4:04 
AnswerRe: decimal separator Pin
led mike23-Jul-08 4:36
led mike23-Jul-08 4:36 
GeneralRe: decimal separator Pin
jeremie.delaitre23-Jul-08 4:54
jeremie.delaitre23-Jul-08 4:54 
GeneralRe: decimal separator Pin
led mike23-Jul-08 5:58
led mike23-Jul-08 5:58 
QuestionTrackMouse Event Pin
bhanu_850923-Jul-08 3:06
bhanu_850923-Jul-08 3:06 
Dear All,

My requirement is to change the bitmap of the button on mouse move and mouse over. I have used TrackMouse event to do this. But I have problem in this, that is, when I place a mouse over the button the bitmap is changed and again when I take mouse over the button the bitmap is again changed. This looks bad due to painting and re-painting continously. Please advice me a good way. The code is below :
void Test::OnMouseMove(UINT nFlags, CPoint point)
{
	TRACKMOUSEEVENT trackmouseevent;
	if(!click2)
	{
		trackmouseevent.cbSize = sizeof(trackmouseevent);
		trackmouseevent.dwFlags = TME_LEAVE;
		trackmouseevent.hwndTrack = GetSafeHwnd();
		trackmouseevent.dwHoverTime = HOVER_DEFAULT;
		_TrackMouseEvent(&trackmouseevent);
	}
	GetDlgItem (IDC_BUTTON3)->GetWindowRect (&rect); 
	ScreenToClient (&rect); 
	if ((!rect.PtInRect(point)))
	{
		bool val=but2.LoadBitmaps(IDB_BITMAP23,0,IDB_BITMAP23,0);
		but2.Invalidate();
		but2.UpdateWindow();
	}

	GetDlgItem (IDC_BUTTON2)->GetWindowRect (&rect); 
	ScreenToClient (&rect); 
	if ((!rect.PtInRect(point)))
	{
		bool val=input.LoadBitmaps(IDB_BITMAP22,0,IDB_BITMAP22,0);
		input.Invalidate();
		input.UpdateWindow();
	}

	CDialog::OnMouseMove(nFlags, point);
}
LONG Test::OnMouseLeave(WPARAM , LPARAM) 
{
	POINT point;
	GetCursorPos(&point);
	ScreenToClient(&point);
	CRect rect;
	GetDlgItem (IDC_BUTTON2)->GetWindowRect (&rect);  // Window coordinates.
	ScreenToClient (&rect); 
	
	if (rect.PtInRect(point))
	{
		bool val=input.LoadBitmaps(IDB_BITMAP57,0,IDB_BITMAP57,0);
		input.Invalidate();
		input.UpdateWindow();
		click2=false;
	}
GetDlgItem (IDC_BUTTON3)->GetWindowRect (&rect);  // Window coordinates.
	ScreenToClient (&rect); 
	if (rect.PtInRect(point))
	{
		bool val=but2.LoadBitmaps(IDB_BITMAP58,0,IDB_BITMAP58,0);
		but2.Invalidate();
		but2.UpdateWindow();
		click2=false;
		
	}

AnswerRe: TrackMouse Event Pin
enhzflep23-Jul-08 6:00
enhzflep23-Jul-08 6:00 
QuestionHow to handle New Vertical Tab of Window Menu in VS2005 Pin
am 200923-Jul-08 3:06
am 200923-Jul-08 3:06 
QuestionCString Find Pin
Preethi_12323-Jul-08 3:04
Preethi_12323-Jul-08 3:04 
AnswerRe: CString Find Pin
am 200923-Jul-08 3:08
am 200923-Jul-08 3:08 
GeneralRe: CString Find Pin
Preethi_12323-Jul-08 3:23
Preethi_12323-Jul-08 3:23 
AnswerRe: CString Find Pin
Rajesh R Subramanian23-Jul-08 3:16
professionalRajesh R Subramanian23-Jul-08 3:16 
GeneralRe: CString Find Pin
Preethi_12323-Jul-08 3:21
Preethi_12323-Jul-08 3:21 
QuestionCreating dynamic CStatic control without Dialog in VC++ Pin
Member 437038523-Jul-08 3:04
Member 437038523-Jul-08 3:04 
AnswerRe: Creating dynamic CStatic control without Dialog in VC++ Pin
Cedric Moonen23-Jul-08 3:26
Cedric Moonen23-Jul-08 3:26 
QuestionRe: Creating dynamic CStatic control without Dialog in VC++ Pin
David Crow23-Jul-08 3:29
David Crow23-Jul-08 3:29 
AnswerRe: Creating dynamic CStatic control without Dialog in VC++ Pin
CPallini23-Jul-08 7:00
mveCPallini23-Jul-08 7:00 
Questionxml reading using vc++ Pin
V K 223-Jul-08 2:54
V K 223-Jul-08 2:54 
AnswerRe: xml reading using vc++ Pin
CPallini23-Jul-08 7:11
mveCPallini23-Jul-08 7:11 
QuestionProblem with DateTime picker control. Pin
Sanjay K23-Jul-08 2:45
Sanjay K23-Jul-08 2:45 
AnswerRe: Problem with DateTime picker control. Pin
Cedric Moonen23-Jul-08 3:25
Cedric Moonen23-Jul-08 3:25 
GeneralRe: Problem with DateTime picker control. Pin
Sanjay K23-Jul-08 17:55
Sanjay K23-Jul-08 17:55 
QuestionRe: Problem with DateTime picker control. Pin
David Crow23-Jul-08 3:31
David Crow23-Jul-08 3:31 

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.