?
Solved

Button as hyperlink in MFC

Posted on 2004-03-24
6
Medium Priority
?
654 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 800 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Starting up a Project
Suggested Courses

770 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