Click here to Skip to main content
15,914,327 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: "urgent""""how to read a file ?? Pin
Johan Rosengren28-Jun-04 9:35
Johan Rosengren28-Jun-04 9:35 
GeneralRe: "urgent""""how to read a file ?? Pin
Jörgen Sigvardsson28-Jun-04 10:12
Jörgen Sigvardsson28-Jun-04 10:12 
GeneralRe: "urgent""""how to read a file ?? Pin
Nick Parker28-Jun-04 10:59
protectorNick Parker28-Jun-04 10:59 
Generallinking problem with <complex> Pin
PDHB28-Jun-04 7:36
PDHB28-Jun-04 7:36 
GeneralRe: linking problem with &lt;complex&gt; Pin
Anthony_Yio28-Jun-04 17:06
Anthony_Yio28-Jun-04 17:06 
GeneralRe: linking problem with &lt;complex&gt; Pin
PDHB29-Jun-04 5:26
PDHB29-Jun-04 5:26 
Question[MFC] OnToolHitTest not working well? Pin
Maarten Kools28-Jun-04 7:04
professionalMaarten Kools28-Jun-04 7:04 
Generalperform action on close [X] button Pin
elephantstar28-Jun-04 6:58
elephantstar28-Jun-04 6:58 
Why is it that I can't get this window to call OnSysCommand when the user clicks on the Close [X] button. Is there something wrong with my code that someone can point out or am I leaving something out? Thanks!

/*************************************/
CClass1.h

class CClass1: public CFormView
{
....code.....

protected:
// Generated message map functions
//{{AFX_MSG(Class1)
afx_msg void OnSysCommand(UINT nID,LPARAM lParam);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

CClass1.cpp
BEGIN_MESSAGE_MAP(CClass1, CFormView)
//{{AFX_MSG_MAP(CClass1)
ON_WM_SYSCOMMAND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CClass1::OnSysCommand(UINT nID, LPARAM lParam)
{
if(nID == SC_CLOSE) //Check If [X] Button
{
AfxMessageBox(_T("Hello"));
}
else
CFormView::OnSysCommand(nID, lParam);
}
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 10:07
Neville Franks28-Jun-04 10:07 
GeneralRe: perform action on close [X] button Pin
elephantstar28-Jun-04 11:16
elephantstar28-Jun-04 11:16 
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 11:28
Neville Franks28-Jun-04 11:28 
GeneralRe: perform action on close [X] button Pin
elephantstar28-Jun-04 12:25
elephantstar28-Jun-04 12:25 
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 12:31
Neville Franks28-Jun-04 12:31 
GeneralRe: perform action on close [X] button Pin
elephantstar28-Jun-04 12:41
elephantstar28-Jun-04 12:41 
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 12:48
Neville Franks28-Jun-04 12:48 
GeneralRe: perform action on close [X] button Pin
elephantstar28-Jun-04 13:13
elephantstar28-Jun-04 13:13 
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 13:20
Neville Franks28-Jun-04 13:20 
GeneralRe: perform action on close [X] button Pin
elephantstar28-Jun-04 14:51
elephantstar28-Jun-04 14:51 
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 14:57
Neville Franks28-Jun-04 14:57 
GeneralRe: perform action on close [X] button Pin
elephantstar29-Jun-04 8:23
elephantstar29-Jun-04 8:23 
GeneralRe: perform action on close [X] button Pin
Neville Franks29-Jun-04 10:38
Neville Franks29-Jun-04 10:38 
GeneralRe: perform action on close [X] button Pin
elephantstar29-Jun-04 13:01
elephantstar29-Jun-04 13:01 
GeneralRe: perform action on close [X] button Pin
Neville Franks29-Jun-04 13:43
Neville Franks29-Jun-04 13:43 
GeneralRe: perform action on close [X] button Pin
*Dreamz28-Jun-04 18:33
*Dreamz28-Jun-04 18:33 
GeneralRe: perform action on close [X] button Pin
elephantstar29-Jun-04 9:01
elephantstar29-Jun-04 9:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.