Click here to Skip to main content
16,004,860 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDifference between VC.6 and VC.NET Pin
vikas amin20-Oct-05 20:46
vikas amin20-Oct-05 20:46 
AnswerRe: Difference between VC.6 and VC.NET Pin
toxcct20-Oct-05 21:17
toxcct20-Oct-05 21:17 
GeneralRe: Difference between VC.6 and VC.NET Pin
vikas amin20-Oct-05 21:28
vikas amin20-Oct-05 21:28 
GeneralRe: Difference between VC.6 and VC.NET Pin
toxcct20-Oct-05 21:36
toxcct20-Oct-05 21:36 
GeneralRe: Difference between VC.6 and VC.NET Pin
S. Senthil Kumar20-Oct-05 22:56
S. Senthil Kumar20-Oct-05 22:56 
QuestionHow to apply a Hand cursor to a Picture box Pin
snprani20-Oct-05 20:42
snprani20-Oct-05 20:42 
AnswerRe: How to apply a Hand cursor to a Picture box Pin
Cedric Moonen20-Oct-05 21:08
Cedric Moonen20-Oct-05 21:08 
AnswerRe: How to apply a Hand cursor to a Picture box Pin
Mircea Puiu20-Oct-05 21:37
Mircea Puiu20-Oct-05 21:37 
Hi,

Assume CYourControl is the class implementing your image or whatever you are using, and TheParent is the class corresponding to the host of your control.
Write the following code within the handler responding to the WM_SETCURSOR event:
BOOL TheParent::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
{
	// TODO: Add your message handler code here and/or call default
	CYourControl *pYC = ...... // get here the pointer to your control

	if ( pYC )
	{
		if ( pWnd == pYC )
		{
			SetCursor(LoadCursor(NULL,IDC_YOUR_CURSOR));
			return TRUE;
		}
	}
	
	return TheParentBaseClass::OnSetCursor(pWnd, nHitTest, message);
}

IDC_HAND Windows is defined for NT 5.0 and later.
You can create your own cursor.
Do not forget that line returning TRUE!

SkyWalker

-- modified at 3:38 Friday 21st October, 2005
GeneralRe: How to apply a Hand cursor to a Picture box Pin
Eytukan21-Oct-05 1:34
Eytukan21-Oct-05 1:34 
GeneralRe: How to apply a Hand cursor to a Picture box Pin
Mircea Puiu21-Oct-05 1:45
Mircea Puiu21-Oct-05 1:45 
GeneralRe: How to apply a Hand cursor to a Picture box Pin
Eytukan21-Oct-05 2:02
Eytukan21-Oct-05 2:02 
GeneralRe: How to apply a Hand cursor to a Picture box Pin
Mircea Puiu21-Oct-05 4:45
Mircea Puiu21-Oct-05 4:45 
QuestionHow to change the back colour of a Edit box ??? Pin
vikas amin20-Oct-05 20:36
vikas amin20-Oct-05 20:36 
AnswerRe: How to change the back colour of a Edit box ??? Pin
User 58385220-Oct-05 21:17
User 58385220-Oct-05 21:17 
GeneralRe: How to change the back colour of a Edit box ??? Pin
vikas amin20-Oct-05 21:25
vikas amin20-Oct-05 21:25 
GeneralRe: How to change the back colour of a Edit box ??? Pin
Mircea Puiu20-Oct-05 21:43
Mircea Puiu20-Oct-05 21:43 
GeneralRe: How to change the back colour of a Edit box ??? Pin
vikas amin21-Oct-05 1:00
vikas amin21-Oct-05 1:00 
GeneralRe: How to change the back colour of a Edit box ??? Pin
Eytukan21-Oct-05 0:19
Eytukan21-Oct-05 0:19 
AnswerRe: How to change the back colour of a Edit box ??? Pin
FarPointer21-Oct-05 0:39
FarPointer21-Oct-05 0:39 
AnswerRe: How to change the back colour of a Edit box ??? Pin
ThatsAlok21-Oct-05 1:17
ThatsAlok21-Oct-05 1:17 
GeneralRe: How to change the back colour of a Edit box ??? Pin
Eytukan21-Oct-05 1:37
Eytukan21-Oct-05 1:37 
GeneralRe: How to change the back colour of a Edit box ??? Pin
ThatsAlok21-Oct-05 1:45
ThatsAlok21-Oct-05 1:45 
GeneralRe: How to change the back colour of a Edit box ??? Pin
Eytukan21-Oct-05 2:06
Eytukan21-Oct-05 2:06 
QuestionUrgent : Problem with wifstream() Pin
Supriya Tonape20-Oct-05 19:07
Supriya Tonape20-Oct-05 19:07 
AnswerRe: Urgent : Problem with wifstream() Pin
SteveKing20-Oct-05 19:18
SteveKing20-Oct-05 19:18 

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.