Click here to Skip to main content
15,887,812 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Save an image using CImage class Pin
Hamid_RT13-Jan-09 5:12
Hamid_RT13-Jan-09 5:12 
QuestionRe: Save an image using CImage class Pin
Luc Pattyn12-Jan-09 3:29
sitebuilderLuc Pattyn12-Jan-09 3:29 
AnswerRe: Save an image using CImage class Pin
VC++Maniac12-Jan-09 17:10
VC++Maniac12-Jan-09 17:10 
GeneralRe: Save an image using CImage class Pin
Luc Pattyn12-Jan-09 18:02
sitebuilderLuc Pattyn12-Jan-09 18:02 
GeneralRe: Save an image using CImage class Pin
VC++Maniac12-Jan-09 21:14
VC++Maniac12-Jan-09 21:14 
QuestionHow can set Hand Cursor on Hyperlink? Pin
Le@rner11-Jan-09 22:40
Le@rner11-Jan-09 22:40 
AnswerRe: How can set Hand Cursor on Hyperlink? Pin
Iain Clarke, Warrior Programmer11-Jan-09 23:21
Iain Clarke, Warrior Programmer11-Jan-09 23:21 
AnswerRe: How can set Hand Cursor on Hyperlink? Pin
Harish_kj12-Jan-09 2:32
Harish_kj12-Jan-09 2:32 
Create a message handler function OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) for the message WM_SETCURSOR

Declare a HCURSOR variable in your class
HCURSOR mLinkCursor = NULL;

In the OnInitDialog function, add the below block

if(mLinkCursor == NULL)
{
CString winDir;
GetWindowsDirectory(winDir.GetBuffer(MAX_PATH), MAX_PATH);
winDir.ReleaseBuffer();
winDir += _T("\\WINHLP32.exe");

HMODULE hModule = LoadLibrary(lpzWinDir);
if (hModule)
{
HCURSOR mHandCursor = ::LoadCursor(hModule, MAKEINTRESOURCE(106));
if (mHandCursor)
mLinkCursor = CopyCursor(mHandCursor );
}
FreeLibrary(hModule);
}


Now, you update the added OnSetCursor function as

bool myClass::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// Note: Here IDC_HYPERLINK is nothing but your control Id
// that should get the hand cursor when mouse moves over it.
// Update this to your ctrl Id
if((pWnd->GetDlgCtrlID() == IDC_HYPERLINK) && (mLinkCursor != NULL))
{
::SetCursor(mLinkCursor );
return TRUE;
}
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}


I found this in one of the forums. This should work. Smile | :)


Let me know if you face any problem.

KJ
QuestionError messages Pin
vanishaa11-Jan-09 21:26
vanishaa11-Jan-09 21:26 
AnswerRe: Error messages Pin
Stuart Dootson11-Jan-09 21:46
professionalStuart Dootson11-Jan-09 21:46 
Question[Message Deleted] Pin
Alex@9C11-Jan-09 21:19
Alex@9C11-Jan-09 21:19 
NewsRe: Tabs in the Container window of the CPropertySheet not getting in RTL layout. Pin
Iain Clarke, Warrior Programmer11-Jan-09 22:11
Iain Clarke, Warrior Programmer11-Jan-09 22:11 
GeneralRe: Tabs in the Container window of the CPropertySheet not getting in RTL layout. Pin
Cedric Moonen11-Jan-09 22:31
Cedric Moonen11-Jan-09 22:31 
AnswerRe: [Message Deleted] Pin
Iain Clarke, Warrior Programmer12-Jan-09 0:12
Iain Clarke, Warrior Programmer12-Jan-09 0:12 
GeneralRe: [Message Deleted] Pin
Hamid_RT12-Jan-09 1:02
Hamid_RT12-Jan-09 1:02 
GeneralRe: [Message Deleted] Pin
Iain Clarke, Warrior Programmer12-Jan-09 1:27
Iain Clarke, Warrior Programmer12-Jan-09 1:27 
QuestionUSB Device Name Pin
newhivc11-Jan-09 20:39
newhivc11-Jan-09 20:39 
QuestionRe: USB Device Name Pin
Roger Stoltz11-Jan-09 21:38
Roger Stoltz11-Jan-09 21:38 
AnswerRe: USB Device Name Pin
Iain Clarke, Warrior Programmer11-Jan-09 22:08
Iain Clarke, Warrior Programmer11-Jan-09 22:08 
AnswerRe: USB Device Name [modified] Pin
Jijo.Raj11-Jan-09 22:17
Jijo.Raj11-Jan-09 22:17 
GeneralRe: USB Device Name Pin
Hamid_RT12-Jan-09 1:00
Hamid_RT12-Jan-09 1:00 
GeneralRe: USB Device Name Pin
Jijo.Raj12-Jan-09 5:12
Jijo.Raj12-Jan-09 5:12 
GeneralRe: USB Device Name Pin
Hamid_RT12-Jan-09 7:48
Hamid_RT12-Jan-09 7:48 
AnswerRe: USB Device Name Pin
Hamid_RT12-Jan-09 1:00
Hamid_RT12-Jan-09 1:00 
Questionfinding dependencies Pin
kir_MFC11-Jan-09 19:34
kir_MFC11-Jan-09 19:34 

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.