June 21st, 2010, 03:37 PM
Visual C++ : How can put a clickable URL in a dialog?
How can put a clickable URL in a dialog?
It’s getting quite common these days to place a URL to a web site in about boxes. But how do you this in a typical MFC app? Well, first you need a static which will respond to being clicked. Let’s assume you have a static named IDC_URL in your dialog, which has as its text the URL for your website. You need to apply the SS_NOTIFY style to this static (i.e. check the Notify checkbox in the static’s properties dialog). Then you need to override the WM_COMMAND handler for the dialog which hosts the static, and place code something like that below in it:
view plaincopy to clipboardprint?
BOOL CTestbed2Dlg::OnCommand(WPARAM wParam, LPARAM lParam)
if (HIWORD(wParam) == STN_CLICKED)
if (LOWORD(wParam) == IDC_URL)
FromHandle ((HWND)lParam)->GetWindowText (csURL);
Last edited by ovidiucucu; June 22nd, 2010 at 06:02 AM.
Reason: Remove ad links.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!