• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 657
  • Last Modified:

Button as hyperlink in MFC

Hi all
  I am drawing bitmap image on a button and now I want to make the button as hyperlink in MFC.
Is there any way in MFC ?
Thanks
With Regards
Sunil Joshi
0
sunil_djoshi
Asked:
sunil_djoshi
  • 2
1 Solution
 
Daniel JungesCommented:
Captute BN_CLICKED event and then execute the link with CreateProcess, it will open you default browser:
PROCESS_INFORMATION pi;
CreateProcess("http:\\myhost.com", 0, 0, 0, FALSE, CREATE_NEW_CONSOLE, 0, 0, 0, &pi);

If you want to change the cursor on mouse over, then you need to capture the mouse enter and exit. Please read the follow thread, it treats exactly this issue:

http://groups.google.com/groups?threadm=32475699.579A%40ix.netcom.com&rnum=2
0
 
DanRollinsCommented:
Another (similar) option...
In your OnClickXxxxx handler, use ShellExecute, like so:

     ShellExecute(NULL, "open", "http://www.yahoo.com",NULL, NULL,SW_SHOWNORMAL);

-- Dan
0
 
sunil_djoshiAuthor Commented:
Hi junges
Thanks a lot fpr the answer and sorry for the late reply
 your solution works very fine
thanks a lot
Sunil Joshi
0
 
DanRollinsCommented:
sunil_djoshi,
The best way to thank an EE Expert is to click the [Accept] button next to his comment, then select the "Excellent" radio button and click [Submit]
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now