资源简介
vc++ 运用MFC实现基于AfxMessageBox的 自定义弹出窗
这是运用MFC技术实现的基于AfxMessageBox的自定义弹出窗,与标准的 MessageBox 相比,MFC提供 AfxMessageBox 方法使我们编写消息框变得更加容易。本弹出窗是经过自定义扩展的,过一段时间消息框就能自动关闭

代码片段和文件信息
// Hyperlink.cpp : implementation file
// Download by http://www.codefans.net
// Hyperlink static control. Will open the default browser with the given URL
// when the user clicks on the link.
//
// Copyright (C) 1997 - 1999 Chris Maunder
// All rights reserved. May not be sold for profit.
//
// Thanks to P錶 K. T鴑der for auto-size and window caption changes.
//
// “GotoURL“ function by Stuart Patterson
// As seen in the August 1997 Windows Developer‘s Journal.
// Copyright 1997 by Miller Freeman Inc. All rights reserved.
// Modified by Chris Maunder to use TCHARs instead of chars.
//
// “Default hand cursor“ from Paul DiLascia‘s Jan 1998 MSJ article.
//
// 2/29/00 -- P. Shaffer standard font mod.
#include “stdafx.h“
#include
#include “Hyperlink.h“
#include
#include “atlconv.h“ // for Unicode conversion - requires #include // MFC OLE automation classes
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define TOOLTIP_ID 1
/////////////////////////////////////////////////////////////////////////////
// CHyperlink
CHyperlink::CHyperlink()
{
m_hlinkCursor = NULL; // No cursor as yet
m_crlinkColour = RGB( 0 0 238); // Blue
m_crVisitedColour = RGB( 85 26 139); // Purple
m_crHoverColour = RGB(255 0 0); // Red
m_bOverControl = FALSE; // Cursor not yet over control
m_bVisited = FALSE; // Hasn‘t been visited yet.
m_nUnderline = ulHover; // Underline the link?
m_bAdjustToFit = TRUE; // Resize the window to fit the text?
m_strURL.Empty();
m_nTimerID = 100;
}
CHyperlink::~CHyperlink()
{
m_UnderlineFont.Deleteobject();
}
/////////////////////////////////////////////////////////////////////////////
// CHyperlink overrides
BOOL CHyperlink::DestroyWindow()
{
KillTimer(m_nTimerID);
return CStatic::DestroyWindow();
}
BOOL CHyperlink::PreTranslateMessage(MSG* pMsg)
{
m_ToolTip.RelayEvent(pMsg);
return CStatic::PreTranslateMessage(pMsg);
}
void CHyperlink::PreSubclassWindow()
{
// We want to get mouse clicks via STN_CLICKED
DWORD dwstyle = Getstyle();
::SetWindowLong(GetSafeHwnd() GWL_style dwstyle | SS_NOTIFY);
// Set the URL as the window text
if (m_strURL.IsEmpty())
GetWindowText(m_strURL);
// Check that the window text isn‘t empty. If it is set it as the URL.
CString strWndText;
GetWindowText(strWndText);
if (strWndText.IsEmpty())
{
ASSERT(!m_strURL.IsEmpty()); // Window and URL both NULL. DUH!
SetWindowText(m_strURL);
}
CFont* pFont = GetFont();
if (!pFont)
{
HFONT hFont = (HFONT)GetStockobject(DEFAULT_GUI_FONT);
if (hFont == NULL)
hFont = (HFONT) GetStockobject(ANSI_VAR_FONT
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
----------- --------- ---------- ----- ----
47011 18
相关资源
- VC++ 多线程文件读写操作
- 移木块游戏,可以自编自玩,vc6.0编写
- VC++MFC小游戏实例教程(实例)+MFC类库
- VC++实现CMD命令执行与获得返回信息
- VC++基于OpenGL模拟的一个3维空间模型
- 基于VC++的SolidWorks二次开发SolidWorks
- 派克变换VC++源码(附文档)
- VC++ 串口
- VC++ 大富翁4_大富翁游戏源码
- VC++ 摄像头视频采集与回放源程序
- 转 VC++ 实现电子邮件(Email)发送
- 基于MFC的VC++仿QQ浏览器源码(雏形)
- VC++ 服务程序编写及安装与卸载
- VC++6.0番茄西红柿VAXvirsual assist X完美破
- 基于改进的fcm算法的图像分割vc++
- VC++6.0 绿色版,免安装,非常好用。
- Microsoft Visual C++ 2005 Redistributable Pack
- VC++MFC课程设计的学生成绩管理系统
- 大智慧365DLL插件设计
- VC++6.0汉化包
- VC++完整商业界面源码(再上传)
- VC++编程技术600个大型项目源码.rar
- VC++实现RSA加密算法
- VC++ 中国象棋经典游戏源代码
- 郁金香VC++游戏辅助视频教程
- C语言进阶源码---基于graphics实现图书
- 摄影测量相对定向VC++程序
- VC++数字图像处理典型算法及实现
- VC++酒店客房管理系统 MFC
- 车站计算机联锁vc++6.0程序代码
评论
共有 条评论