Click here to Skip to main content
15,886,799 members
Articles / Desktop Programming / MFC

Win32 Hyperlink Control

Rate me:
Please Sign up or sign in to vote.
4.60/5 (7 votes)
25 Aug 20055 min read 46.3K   712   19  
Introducing the modified worker object pattern by developing a hyperlink control without using the MFC.
/**
 * Copyright (C) 2002-2005
 * W3L GmbH
 * Technologiezentrum Ruhr
 * Universit�tsstra�e 142
 * D-44799 Bochum
 * 
 * Author: Dipl.Ing. Doga Arinir
 * E-Mail: doga.arinir@w3l.de
 *
 * This software is provided 'as-is', without any express or implied
 * warranty.  In no event will the author or the company be held liable 
 * for any damages arising from the use of this software. EXPECT BUGS!
 * 
 * You may use this software in compiled form in any way you desire PROVIDING it is
 * not sold for profit without the authors written permission, and providing that this
 * notice and the authors name is included. If the source code in this file is used in 
 * any commercial application then acknowledgement must be made to the author of this file.
 */

#if !defined(AFX_HYPERLINK_H__7544C8BB_6031_422B_BA0E_820CCBD5DC25__INCLUDED_)
#define AFX_HYPERLINK_H__7544C8BB_6031_422B_BA0E_820CCBD5DC25__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <string>

class CHyperlink  
{
class _autoinitializer
{
public:
	_autoinitializer();
	~_autoinitializer();
protected:
	HMODULE hModule;
};
friend class _autoinitializer;
public:
	CHyperlink();
	virtual ~CHyperlink();

	bool create(int resourceid, HWND parent);
	bool create(RECT rect, const char *url, HWND parent);
	bool create(int x1, int y1, int x2, int y2, const char *url, HWND parent);

protected:
	std::string m_Url;
	HWND m_hWnd;

	static _autoinitializer __autoinitializer;
	static HCURSOR handcursor;
	static int WndProc(HWND hwnd,WORD wMsg,WPARAM wParam,LPARAM lParam);
};

#endif // !defined(AFX_HYPERLINK_H__7544C8BB_6031_422B_BA0E_820CCBD5DC25__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Chief Technology Officer W3L
Germany Germany
-Since 1th August 2007: Chief Technology Officer of W3L
-2002/08/01-2007/07/31: PhD student
-1997/10/15-2002/07/31: Studied Electrical Engineering and Computer Science

Comments and Discussions