Click here to Skip to main content
16,005,491 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Programme is bad. Pin
jmkhael21-Apr-04 5:26
jmkhael21-Apr-04 5:26 
GeneralRe: Programme is bad. Pin
toxcct21-Apr-04 5:32
toxcct21-Apr-04 5:32 
GeneralRe: Programme is bad. Pin
Ravi Bhavnani21-Apr-04 7:06
professionalRavi Bhavnani21-Apr-04 7:06 
GeneralRe: Programme is bad. Pin
Prakash Nadar21-Apr-04 8:25
Prakash Nadar21-Apr-04 8:25 
GeneralTabbed Controls with Tool Bars Pin
cleathley@iinet21-Apr-04 4:42
cleathley@iinet21-Apr-04 4:42 
GeneralCustom Cursor causes cursor to flick when moving the mouse Pin
stelitsisan21-Apr-04 4:41
stelitsisan21-Apr-04 4:41 
GeneralRe: Custom Cursor causes cursor to flick when moving the mouse Pin
Ravi Bhavnani21-Apr-04 4:43
professionalRavi Bhavnani21-Apr-04 4:43 
GeneralRe: Custom Cursor causes cursor to flick when moving the mouse Pin
Iain Clarke, Warrior Programmer21-Apr-04 5:51
Iain Clarke, Warrior Programmer21-Apr-04 5:51 
SetCursor itself only works for a while.

You need to do two things: Set the window class cursor to NULL, and handle the WM_SETCURSOR message
to NULL.

So...
char	__myclass [] = "Midas3View";

BOOL CMyView::PreCreateWindow( CREATESTRUCT& cs )
{
	WNDCLASS	wc;
	wc.style		= CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
	wc.lpfnWndProc	= ::DefWindowProc;
	wc.cbClsExtra	= 0;
	wc.cbWndExtra	= 0;
	wc.hInstance	= cs.hInstance;
	wc.hIcon		= 0;
	wc.hCursor		= 0;   // <------ The important bit.
	wc.hbrBackground= NULL;
	wc.lpszMenuName	= NULL;
	wc.lpszClassName= __myclass;

	AfxRegisterClass (&wc);

	cs.lpszClass = __myclass;

	return	TRUE;
}

...to remove the default cursor. And...
...
   ON_WM_SETCURSOR()
...

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

    if (m_bNote1)
       SetCursor (cursor used with Note 1);
    else
       SetCursor (other cursor...);
   
    return TRUE;
}

To set the cursor on the fly.

You can probably search OnSetCursor in MSDN for all this information.

Good luck,

Iain.
GeneralCreate Windows Service with C++ Pin
andysmurfen21-Apr-04 4:04
andysmurfen21-Apr-04 4:04 
GeneralRe: Create Windows Service with C++ Pin
Antony M Kancidrowski21-Apr-04 5:06
Antony M Kancidrowski21-Apr-04 5:06 
GeneralRe: Create Windows Service with C++ Pin
tareqsiraj21-Apr-04 5:27
tareqsiraj21-Apr-04 5:27 
GeneralRe: Create Windows Service with C++ Pin
Mike Dimmick21-Apr-04 6:00
Mike Dimmick21-Apr-04 6:00 
QuestionHow do I type a System._ComObject? Pin
mhuslig21-Apr-04 4:03
mhuslig21-Apr-04 4:03 
QuestionHow do I close a running program? Pin
IronMaiden42021-Apr-04 3:53
IronMaiden42021-Apr-04 3:53 
AnswerRe: How do I close a running program? Pin
jmkhael21-Apr-04 3:54
jmkhael21-Apr-04 3:54 
GeneralRe: How do I close a running program? Pin
Shail_Srivastav21-Apr-04 5:14
Shail_Srivastav21-Apr-04 5:14 
QuestionConnectionPoint Interface? Pin
ndalal21-Apr-04 3:42
ndalal21-Apr-04 3:42 
GeneralPorting Mac to Win, WaitMouseMoved Pin
Maarten Kools21-Apr-04 3:27
professionalMaarten Kools21-Apr-04 3:27 
GeneralRe: Porting Mac to Win, WaitMouseMoved Pin
Anonymous21-Apr-04 3:47
Anonymous21-Apr-04 3:47 
GeneralRe: Porting Mac to Win, WaitMouseMoved Pin
Maarten Kools21-Apr-04 4:58
professionalMaarten Kools21-Apr-04 4:58 
GeneralIf anyone from Microsoft is reading this (VC++ 7.1) Pin
Giles21-Apr-04 3:25
Giles21-Apr-04 3:25 
GeneralRe: If anyone from Microsoft is reading this (VC++ 7.1) Pin
David Crow21-Apr-04 5:18
David Crow21-Apr-04 5:18 
GeneralGetting the battery Status Pin
rallister21-Apr-04 3:19
rallister21-Apr-04 3:19 
GeneralRe: Getting the battery Status Pin
Anonymous21-Apr-04 3:45
Anonymous21-Apr-04 3:45 
GeneralListCtrl Scroll Messages Pin
Greg Ellis21-Apr-04 3:10
Greg Ellis21-Apr-04 3:10 

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.