Click here to Skip to main content
15,895,084 members
Articles / Desktop Programming / WTL

Burn the Edges of Your Windows to Give Them Character

Rate me:
Please Sign up or sign in to vote.
4.92/5 (13 votes)
31 Mar 2008CPOL2 min read 38.2K   388   35  
No, that's not a typo
// maindlg.h : interface of the CMainDlg class
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MAINDLG_H__F485C194_D644_4C7E_A449_26632A2BCA53__INCLUDED_)
#define AFX_MAINDLG_H__F485C194_D644_4C7E_A449_26632A2BCA53__INCLUDED_

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

class CMainDlg : public CDialogImpl<CMainDlg>, public CMessageFilter
{
public:
    enum { IDD = IDD_MAINDLG };

    // Construction
    CMainDlg();

    // Maps
    BEGIN_MSG_MAP(CMainDlg)
        MSG_WM_INITDIALOG(OnInitDialog)
        MSG_WM_DESTROY(OnDestroy)
        MSG_WM_LBUTTONDOWN(OnLButtonDown)
        MSG_WM_LBUTTONDBLCLK(OnLButtonDblclk)
        MSG_WM_MBUTTONUP(OnMButtonUp)
        MSG_WM_RBUTTONUP(OnRButtonUp)
        COMMAND_ID_HANDLER_EX(ID_APP_ABOUT, OnAppAbout)
        COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel)
    END_MSG_MAP()

    // Message handlers
    BOOL PreTranslateMessage(MSG* pMsg);
    BOOL OnIdle();

    BOOL OnInitDialog(HWND hwndFocus, LPARAM lParam);
    void OnDestroy();
    void OnLButtonDown(UINT uKeys, CPoint pt);
    void OnLButtonDblclk(UINT uKeys, CPoint pt);
    void OnMButtonUp(UINT uKeys, CPoint pt);
    void OnRButtonUp(UINT uKeys, CPoint pt);

    // Command handlers
    void OnAppAbout(UINT uCode, int nID, HWND hwndCtrl);
    void OnCancel(UINT uCode, int nID, HWND hwndCtrl);

protected:
    CRgn m_rgnOriginal;
    vector<HRGN> m_vecRgns;
    UINT m_uCurrRgn;

    HRGN RotateRegion ( CRgnHandle rgn, int degrees );

    void CreateRegions();
    void CreateRegion1();
    void CreateRegion2();
    void CreateRegion3();
};


/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_MAINDLG_H__F485C194_D644_4C7E_A449_26632A2BCA53__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) VMware
United States United States
Michael lives in sunny Mountain View, California. He started programming with an Apple //e in 4th grade, graduated from UCLA with a math degree in 1994, and immediately landed a job as a QA engineer at Symantec, working on the Norton AntiVirus team. He pretty much taught himself Windows and MFC programming, and in 1999 he designed and coded a new interface for Norton AntiVirus 2000.
Mike has been a a developer at Napster and at his own lil' startup, Zabersoft, a development company he co-founded with offices in Los Angeles and Odense, Denmark. Mike is now a senior engineer at VMware.

He also enjoys his hobbies of playing pinball, bike riding, photography, and Domion on Friday nights (current favorite combo: Village + double Pirate Ship). He would get his own snooker table too if they weren't so darn big! He is also sad that he's forgotten the languages he's studied: French, Mandarin Chinese, and Japanese.

Mike was a VC MVP from 2005 to 2009.

Comments and Discussions