Click here to Skip to main content
15,886,063 members
Articles / Web Development / HTML

Style Inspector

Rate me:
Please Sign up or sign in to vote.
4.86/5 (41 votes)
12 Dec 2004CPOL7 min read 112.4K   2.4K   59  
Free tool (with source code) to inspect style.
// Author:		Dr. Puiu
// Creation:	2004

// StyleInspectorDlg.h : header file
//

#if !defined(AFX_STYLEINSPECTORDLG_H__8B8D66F1_8D59_41B6_B77D_AB1AC46E1060__INCLUDED_)
#define AFX_STYLEINSPECTORDLG_H__8B8D66F1_8D59_41B6_B77D_AB1AC46E1060__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "MyInfoDlg.h"
#include <afxtempl.h>

/////////////////////////////////////////////////////////////////////////////
// CStyleInspectorDlg dialog
class CMyHTMLElement
{
public:
	CMyHTMLElement() {}
	~CMyHTMLElement() {}
	long		lLeft;
	long		lTop;
	long		lWidth;
	long		lHeight;
	CString		strLink;
	COLORREF	ulColor;
};

class CStyleInspectorDlg : public CDialog
{
// Construction
public:
	void GetConnectedToShellWindows();
	CStyleInspectorDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CStyleInspectorDlg)
	enum { IDD = IDD_STYLEINSPECTOR_DIALOG };
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CStyleInspectorDlg)
	public:
	virtual void WinHelp(DWORD dwData, UINT nCmd = HELP_CONTEXT);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

public:
	int FindClassNameInString(CString &strContainer, CString &strToLookFor);
	bool m_bOriginIsSet;
	CList <CString, CString> m_listElements;
	bool m_bPageIsLoadedAndSelected;
	COLORREF m_colorBkGnd;
	CBrush m_brushBkGnd;
	CRgn m_rgnWnd;
	long m_lOriginTop;
	long m_lOriginLeft;
	CMyInfoDlg m_dlgInfo;
	void FindStyleClasses(IHTMLDocument2 *lpHtmlDocument);
	void UpdateListOfWindows();
	DECLARE_DISPATCH_MAP()
	void IsRegistered(long lCookie);
	void IsRevoked(long lCookie);

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CStyleInspectorDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnButtonRefresh();
	afx_msg void OnMove(int x, int y);
	afx_msg void OnButtonSetDocOrigin();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STYLEINSPECTORDLG_H__8B8D66F1_8D59_41B6_B77D_AB1AC46E1060__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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Europe Europe
More than 30 years of software development experience.
(also playing the SCRUM Master role depending on the project)

Comments and Discussions