Solved

Button as hyperlink in MFC

Posted on 2004-03-24
6
649 Views
Last Modified: 2012-08-13
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
Comment
Question by:sunil_djoshi
  • 2
6 Comments
 
LVL 14

Expert Comment

by:Daniel Junges
ID: 10667041
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
 
LVL 49

Accepted Solution

by:
DanRollins earned 200 total points
ID: 10675121
Another (similar) option...
In your OnClickXxxxx handler, use ShellExecute, like so:

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

-- Dan
0
 

Author Comment

by:sunil_djoshi
ID: 10746620
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
 
LVL 49

Expert Comment

by:DanRollins
ID: 10747088
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question