Saturday, May 22, 2010

Visual C++ Programmers help...!!!!...?

I have created a mini application (just for fun).


My main objective is that when application is in fullscreen, timer starts counting in seconds until it reaches 4 e.g. for every four seconds, mouse pointer will disappear and will appear again when mouse is moved.





I am using MFC. My problem is that when I use the predefined function OnFullScreen(BOOL bFullScreen) and bFullScreen was already set to true, and when I run the application, mouse pointer still remains on the screen when reaches 4 seconds.





My code for OnFullScreen is this:





void MyView :: OnFullScreen(BOOL bFullScreen)


{


// I also tried if statements for this... and still it doesn't work


switch(bFullScreen)


{


case true: MessageBox("Sample Test", "Check", MB_OK);


break;


default:


MessageBox("is not true", "Check", MB_OK);


}





Please help. I assure you that when I am satisfied with your answer, I will give you the credits by choosing you as the best answerer...


Thanks and God Bless

Visual C++ Programmers help...!!!!...?
How do you hide the pointer ?





ShowCursor(FALSE) must hide the mouse pointer:





http://msdn2.microsoft.com/en-us/library...





The message box that you show may be messing it up. You may also want to set Window's class cursor:





SetClassLong(m_hWnd, GCL_HCURSOR, NULL);





This changes Window class cursor and helps prevent the system from changing it when the mouse is moved.


No comments:

Post a Comment