Click here to Skip to main content
15,893,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how can i change main tool bar button state ? Pin
Roger Allen19-Feb-03 5:21
Roger Allen19-Feb-03 5:21 
AnswerRe: how can i change main tool bar button state ? Pin
Iain Clarke, Warrior Programmer19-Feb-03 5:24
Iain Clarke, Warrior Programmer19-Feb-03 5:24 
GeneralRe: how can i change main tool bar button state ? Pin
Roger Allen19-Feb-03 5:28
Roger Allen19-Feb-03 5:28 
GeneralRe: how can i change main tool bar button state ? Pin
Iain Clarke, Warrior Programmer19-Feb-03 5:39
Iain Clarke, Warrior Programmer19-Feb-03 5:39 
GeneralRe: how can i change main tool bar button state ? Pin
Roger Allen19-Feb-03 6:00
Roger Allen19-Feb-03 6:00 
QuestionHow can i set different cursors of a view ? Pin
muna_utkal19-Feb-03 4:45
muna_utkal19-Feb-03 4:45 
AnswerRe: How can i set different cursors of a view ? Pin
Roger Allen19-Feb-03 5:18
Roger Allen19-Feb-03 5:18 
AnswerRe: How can i set different cursors of a view ? Pin
Iain Clarke, Warrior Programmer19-Feb-03 5:19
Iain Clarke, Warrior Programmer19-Feb-03 5:19 
You need to handle the WM_SETCURSOR message. Here is some code lifted
straight from application of mine. (OK, I cut some long winded bits)

BOOL CMidasViewFlat::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
{
	if (nHitTest != HTCLIENT)
		return CMidasView::OnSetCursor(pWnd, nHitTest, message);

...Obscure case removed here...

	::SetCursor (m_hModeCursor [m_nMouseMode - IDM_TOOLS_MB_FLAT_FIRST]);
	return	TRUE;
}


Of course, this won't work if you haven't got any cursors...
CMidasViewFlat::CMidasViewFlat ()
{
	// Load the cursors
	for (int n = IDM_TOOLS_MB_FLAT_FIRST; n <= IDM_TOOLS_MB_FLAT_LAST; n++)
		m_hModeCursor [n - IDM_TOOLS_MB_FLAT_FIRST] = ::LoadCursor (ghInstance, MAKEINTRESOURCE (n));
...Snipped...
}


You will also need to change the "mouse mode" depending on the tool button you
just pressed:

ON_COMMAND_RANGE(IDM_TOOLS_MB_FLAT_FIRST, IDM_TOOLS_MB_FLAT_LAST, OnToolMode)

void	CMidasViewFlat::OnToolMode (UINT nToolMode)
{
	m_nMouseMode = nToolMode;
	::SetCursor (m_hModeCursor [m_nMouseMode - IDM_TOOLS_MB_FLAT_FIRST]);
}


I hope that helped...

Iain.
GeneralWNetAddConnection2 Pin
Nic Oughton19-Feb-03 4:38
professionalNic Oughton19-Feb-03 4:38 
GeneralRe: WNetAddConnection2 Pin
Daniel Lohmann22-Feb-03 0:32
Daniel Lohmann22-Feb-03 0:32 
QuestionEnable Printing? Pin
Jon Hulatt19-Feb-03 4:37
Jon Hulatt19-Feb-03 4:37 
AnswerRe: Enable Printing? Pin
Roger Allen19-Feb-03 5:26
Roger Allen19-Feb-03 5:26 
GeneralRe: Enable Printing? Pin
Jon Hulatt19-Feb-03 6:38
Jon Hulatt19-Feb-03 6:38 
QuestionHow Can i change keydown event inside edit box? Pin
muna_utkal19-Feb-03 4:35
muna_utkal19-Feb-03 4:35 
AnswerRe: How Can i change keydown event inside edit box? Pin
adamUK19-Feb-03 9:04
adamUK19-Feb-03 9:04 
GeneralResizing parent with child. Pin
User 988519-Feb-03 4:35
User 988519-Feb-03 4:35 
GeneralRe: Resizing parent with child. Pin
valikac19-Feb-03 9:23
valikac19-Feb-03 9:23 
GeneralCopy protection help Pin
Stefan Dahlin19-Feb-03 4:13
Stefan Dahlin19-Feb-03 4:13 
GeneralRe: Copy protection help Pin
LiquidKnight19-Feb-03 6:48
LiquidKnight19-Feb-03 6:48 
GeneralRe: Copy protection help Pin
Toni7819-Feb-03 11:39
Toni7819-Feb-03 11:39 
GeneralRe: Copy protection help Pin
Stefan Dahlin19-Feb-03 11:43
Stefan Dahlin19-Feb-03 11:43 
GeneralStyle Question... Pin
work_to_live19-Feb-03 3:36
work_to_live19-Feb-03 3:36 
GeneralRe: Style Question... Pin
AlexO19-Feb-03 3:55
AlexO19-Feb-03 3:55 
GeneralLooking for light weight databases (performance is critical) Pin
Chen Venkataraman19-Feb-03 3:17
Chen Venkataraman19-Feb-03 3:17 
GeneralRe: Looking for light weight databases (performance is critical) Pin
AlexO19-Feb-03 3:57
AlexO19-Feb-03 3:57 

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.