コード例 #1
0
///////////////////////////////////////////////////////////////////////////////
// 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);
}
コード例 #2
0
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;
}
コード例 #3
0
ファイル: HyperLink.cpp プロジェクト: likebeta/code-snippets
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
}
コード例 #4
0
ファイル: HyperLink.cpp プロジェクト: Teivaz/TortoiseGit
void CHyperLink::OnClicked()
{
	if(!m_strURL.IsEmpty())
	{
		GotoURL(m_strURL);
	}
	else
	{
		::SendMessage(this->GetParent()->m_hWnd,WM_COMMAND,this->GetDlgCtrlID(),0);
	}
}
コード例 #5
0
ファイル: hyperlink.cpp プロジェクト: 6520874/pipiname
// 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();
	}
}
コード例 #6
0
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();
}
コード例 #7
0
ファイル: XHyperlink.cpp プロジェクト: wermanhme1990/xcommon
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
	}
}
コード例 #8
0
ファイル: HLink.cpp プロジェクト: haokeyy/fahister
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);
}
コード例 #9
0
ファイル: HyperLink.cpp プロジェクト: mikerlg/bionicspider
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
  }
コード例 #10
0
ファイル: AFCWindow.cpp プロジェクト: liuwanbing/liuwanbing
//单击消息
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;
}
コード例 #11
0
///////////////////////////////////////////////////////////////////////////////
// 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();
}
コード例 #12
0
ファイル: urllink.cpp プロジェクト: Meridian59/Meridian59
/// 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)));
  }
}
コード例 #13
0
ファイル: HTMLStatic.cpp プロジェクト: SzAllen/Iap2
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);
	}
	
}
コード例 #14
0
void CPageSetupDlg::OnButtonPrintpower()
{
    GotoURL ("http://partners.webmasterplan.com/click.asp?ref=156987&site=1317&type=b26&bnb=26", SW_SHOW);
}
コード例 #15
0
void CHyperLink::OnClicked()
{
    GotoURL(m_strURL);
}
コード例 #16
0
void CCedtApp::OnHelpFeedback() 
{
	GotoURL(STRING_EMAILADDRESS, SW_SHOW);
}
コード例 #17
0
void CCedtApp::OnHelpSponsoring() 
{
	GotoURL(STRING_SPONSORURL, SW_SHOW);
}
コード例 #18
0
void CCedtApp::OnHelpVisitHomepage() 
{
	GotoURL(STRING_HOMEPAGEURL, SW_SHOW);
}
コード例 #19
0
void CHyperLink::OnClicked()
{
	m_bVisited = TRUE; //(result > HINSTANCE_ERROR);
	SetVisited();						 // Repaint to show visited Color
	GotoURL(m_strURL, SW_SHOW);
}
コード例 #20
0
void CPageSetupDlg::OnButtonFunprint()
{
    GotoURL ("http://partners.webmasterplan.com/click.asp?ref=156987&site=2141&type=b7&bnb=7", SW_SHOW);
}
コード例 #21
0
void CCedtApp::OnHelpTopics() 
{
	GotoURL(m_szInstallDirectory + "\\docs\\index.html", SW_SHOW);
}