1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
class CMonApp:public CWinApp
{
public:
BOOL InitInstance();
};
BOOL CMonApp::InitInstance()
{
CMonFrame *mFRame;
mFrame=new CMonFrame();
m_pMainWnd=mFrame;
m_pMainWnd->ShowWindow(SW_sHOW);
return TRUE;
}
CMonApp monApp;
/******************************************************************/
/* Dans un autre fichier par exemple..ms pas obligé
/******************************************************************/
class CMonFrame:public CFrameWnd
{
protected:
afx_msg void OnLButtonDown(UINT nFlags,CPoint point); // juste pr exemple ici
public:
CMonFrame();
DECLARE_MESSAGE_MAP()
};
CMonFrame::CMonFrame()
{
Create(0,"Titre de la Fenêtre");
}
void CMonFrame::OnLButtonDown(UINT nFlags,CPoint point)
{
MessageBox("titi","réagi qd on clic gauche à l'intérieur du cadre");
}
BEGIN_MESSAGE_MAP(CMonFrame,CFrameWnd)
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP() |
Partager