vc++
Posted Date Unknown Revathy M S 2 Comments

how to handle mouse events in vc++??

See All Responses Below...
Author
Message Rating
Posted on: 12/06/2014
Override OnLButtonDown Message in the Windows Message Handler..

See Some of the Related code in Bold Blue..

class CProcessNameView : public CView
{
protected: // create from serialization only
   //Code snippets
// Operations
public:

// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CProcessNameView)
    public:
    virtual void OnDraw(CDC* pDC);  // overridden to draw this view
    virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
    protected:
    virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
    virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
    virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
    //}}AFX_VIRTUAL

// Implementation
public:
    virtual ~CProcessNameView();
#ifdef _DEBUG
    virtual void AssertValid() const;
    virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
    //{{AFX_MSG(CProcessNameView)
    afx_msg void OnHelpProcessname();
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};

IMPLEMENT_DYNCREATE(CProcessNameView, CView)

BEGIN_MESSAGE_MAP(CProcessNameView, CView)
    //{{AFX_MSG_MAP(CProcessNameView)
    ON_COMMAND(ID_HELP_PROCESSNAME, OnHelpProcessname)
    ON_WM_LBUTTONDOWN()
    //}}AFX_MSG_MAP
    // Standard printing commands
    ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
    ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
    ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

void CProcessNameView::OnLButtonDown(UINT nFlags, CPoint point)
{
    // TODO: Add your message handler code here and/or call default
   
    CView::OnLButtonDown(nFlags, point);
}



Tom

Posted on: 12/06/2014
PLease post VC++ related discussion in the link below from next time onwards..

http://tektips.in/vcpp-discussion-forum.aspx

Main Forum Links..

http://tektips.in/tek-tips-forum.aspx

Tom
Share this page across other social networking sites



Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Comments
   Design  HTML
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site. 

TekTipsDownload
GateExam
Academic Projects
TekTipsExperts



 
Site optimized for IE7, 1280 X 768 and above. Copyright © 2010 - 2018 KTS InfoTech
Site Developed Using KTS WebCloud