/////////////////////////////////////////////////////////////////////////////// // OnClicked void CXHTMLStatic::OnClicked() { CPoint point; ::GetCursorPos(&point); BOOL bOnHyperlink = FALSE; int n = (int) m_AnchorRectPtrs.GetSize(); if (n == 0) return; int i = 0; for (i = 0; i < n; i++) { CRect *pRect = (CRect *) m_AnchorRectPtrs[i]; CRect rect = *pRect; ClientToScreen(&rect); if (rect.PtInRect(point)) // Cursor is currently over control { bOnHyperlink = TRUE; break; } } if (bOnHyperlink) GotoURL(m_AnchorUrls[i], SW_SHOW); }
static BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { switch( msg ) { case WM_INITDIALOG: { CString sMessage = g_sErrorString; sMessage.Replace( "\n", "\r\n" ); SendDlgItemMessage( hWnd, IDC_EDIT_ERROR, WM_SETTEXT, 0, (LPARAM)(LPCTSTR)sMessage ); } break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_BUTTON_VIEW_LOG: { PROCESS_INFORMATION pi; STARTUPINFO si; ZeroMemory( &si, sizeof(si) ); CreateProcess( NULL, // pointer to name of executable module "notepad.exe log.txt", // pointer to command line string NULL, // process security attributes NULL, // thread security attributes false, // handle inheritance flag 0, // creation flags NULL, // pointer to new environment block NULL, // pointer to current directory name &si, // pointer to STARTUPINFO &pi // pointer to PROCESS_INFORMATION ); } break; case IDC_BUTTON_REPORT: GotoURL( "http://sourceforge.net/tracker/?func=add&group_id=37892&atid=421366" ); break; case IDC_BUTTON_RESTART: Win32RestartProgram(); /* not reached */ ASSERT( 0 ); EndDialog( hWnd, 0 ); break; case IDOK: EndDialog( hWnd, 0 ); break; } } return FALSE; }
void CHyperLink::OnClicked() { int result = (int)GotoURL(m_strURL, SW_SHOW); m_bVisited = (result > HINSTANCE_ERROR); if (!m_bVisited) { MessageBeep(MB_ICONEXCLAMATION); // Unable to follow link ReportError(result); } else SetVisited(); // Repaint to show visited colour }
void CHyperLink::OnClicked() { if(!m_strURL.IsEmpty()) { GotoURL(m_strURL); } else { ::SendMessage(this->GetParent()->m_hWnd,WM_COMMAND,this->GetDlgCtrlID(),0); } }
// Activate the link void CHyperLink::FollowLink() { int result = (int) GotoURL(m_strURL, SW_SHOW); if (result <= HINSTANCE_ERROR) { MessageBeep(MB_ICONEXCLAMATION); // Unable to follow link ReportError(result); } else { // Mark link as visited and repaint window m_bVisited = TRUE; Invalidate(); } }
void CStaticHyperLink::OnClicked() { int result = (int)GotoURL(); m_bVisited = (result > HINSTANCE_ERROR); if (!m_bVisited) { ReportError(result); ASSERT(_T("CStaticHyperLink::OnClicked() Failed to load URL")); } else SetVisited(); }
void CXHyperLink::OnClicked() { if (!(m_bVisited = GotoURL(m_strURL, SW_SHOW))) { MessageBeep(MB_ICONEXCLAMATION); // Unable to follow link ReportError(); } else { SetVisited(); // Repaint to show visited colour } }
void CHLink::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default int result = (int)GotoURL(m_strURL, SW_SHOW); m_bVisited = (result > HINSTANCE_ERROR); Invalidate(); CStatic::OnLButtonDown(nFlags, point); }
void CHyperLink::OnClicked() { m_bOverControl = FALSE; HINSTANCE result = GotoURL(m_strURL,SW_SHOW); // m_bVisited = (result > HINSTANCE_ERROR); // if (!m_bVisited) // { // MessageBeep(MB_ICONEXCLAMATION); // Unable to follow link // ReportError(result); // } // else // SetVisited(); // Repaint to show visited colour }
//单击消息 void CHyperLink::OnClicked() { GotoURL(m_strURL,SW_SHOW); //DWORD iResult=(DWORD)GotoURL(m_strURL,SW_SHOW); /*m_bVisited=(iResult>HINSTANCE_ERROR); if (m_bVisited==false) { MessageBeep(MB_ICONEXCLAMATION); ReportError((int)iResult); return; } SetVisited(true);*/ return; }
/////////////////////////////////////////////////////////////////////////////// // OnClicked void CXHyperLink::OnClicked() { m_bOverControl = FALSE; int result = HINSTANCE_ERROR + 1; if (m_bIsURLEnabled) result = (int)(INT_PTR)GotoURL(m_strURL, SW_SHOW, m_bAlwaysOpenNew); m_bVisited = (result > HINSTANCE_ERROR); if (!m_bVisited) { MessageBeep(MB_ICONEXCLAMATION); // Unable to follow link ReportError(result); } else SetVisited(); // Repaint to show visited colour NotifyParent(); }
/// Handles WM_LBUTTONDOWN to process URL requests // void TUrlLink::EvLButtonDown(uint modKeys, const TPoint& point) { TStatic::EvLButtonDown(modKeys, point); // set url !!!!!!!!!!!!!!!!!!1 HINSTANCE result = GotoURL(UrlAddress.c_str(), SW_SHOW); if (result > reinterpret_cast<HINSTANCE>(HINSTANCE_ERROR)){ ReleaseCapture(); bOverControl = false; Invalidate(); SetVisited(); // Repaint to show visited colour } else{ MessageBeep(MB_ICONEXCLAMATION); // Unable to follow link ReportError(static_cast<int>(reinterpret_cast<INT_PTR>(result))); } }
void CHTMLStatic::OnClicked() { // Get the mouse position CPoint pntMouse; GetCursorPos(&pntMouse); // Transform into client coordinates ScreenToClient(&pntMouse); CHTMLAtom * pAnchor; if ( m_htmlDrawer.IsPointInAnchor(pntMouse,pAnchor) ) { HINSTANCE result = GotoURL(pAnchor->GetURL(), SW_SHOW); if ((UINT)result <= HINSTANCE_ERROR) ReportError((int)result); } }
void CPageSetupDlg::OnButtonPrintpower() { GotoURL ("http://partners.webmasterplan.com/click.asp?ref=156987&site=1317&type=b26&bnb=26", SW_SHOW); }
void CHyperLink::OnClicked() { GotoURL(m_strURL); }
void CCedtApp::OnHelpFeedback() { GotoURL(STRING_EMAILADDRESS, SW_SHOW); }
void CCedtApp::OnHelpSponsoring() { GotoURL(STRING_SPONSORURL, SW_SHOW); }
void CCedtApp::OnHelpVisitHomepage() { GotoURL(STRING_HOMEPAGEURL, SW_SHOW); }
void CHyperLink::OnClicked() { m_bVisited = TRUE; //(result > HINSTANCE_ERROR); SetVisited(); // Repaint to show visited Color GotoURL(m_strURL, SW_SHOW); }
void CPageSetupDlg::OnButtonFunprint() { GotoURL ("http://partners.webmasterplan.com/click.asp?ref=156987&site=2141&type=b7&bnb=7", SW_SHOW); }
void CCedtApp::OnHelpTopics() { GotoURL(m_szInstallDirectory + "\\docs\\index.html", SW_SHOW); }