Click here to Skip to main content
15,921,793 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to change the default value of a DAO field object Pin
Joep30-Nov-99 3:06
Joep30-Nov-99 3:06 
AnswerRE: How to change the default value of a DAO field object Pin
Anonymous3-Dec-99 3:18
suss Anonymous3-Dec-99 3:18 
GeneralPrint a dialog box! Pin
sandrine29-Nov-99 22:56
sandrine29-Nov-99 22:56 
GeneralRE: Print a dialog box! Pin
Henk Devos30-Nov-99 7:26
Henk Devos30-Nov-99 7:26 
GeneralRE: Trying to print with a CWinThread... Pin
Chris Maunder27-Nov-99 17:05
cofounderChris Maunder27-Nov-99 17:05 
GeneralShared Directory Pin
Thierry2-Dec-99 21:57
Thierry2-Dec-99 21:57 
GeneralRE: Shared Directory Pin
Serguei Velikevitch3-Dec-99 4:27
sussSerguei Velikevitch3-Dec-99 4:27 
GeneralRE: RE: Shared Directory Pin
Ghazi /Dundas3-Dec-99 5:14
sussGhazi /Dundas3-Dec-99 5:14 
GeneralRE: Shared Directory Pin
ac2713-Dec-99 8:26
sussac2713-Dec-99 8:26 
GeneralRE: RE: Shared Directory Pin
Anonymous3-Dec-99 8:31
suss Anonymous3-Dec-99 8:31 
GeneralRE: RE: Shared Directory Pin
Thierry6-Dec-99 19:48
Thierry6-Dec-99 19:48 
QuestionHow to get the caret's position in a richedit? Pin
Thömmi25-Nov-99 0:43
Thömmi25-Nov-99 0:43 
AnswerRE: How to get the caret's position in a richedit? Pin
Peter Zajac25-Nov-99 6:56
Peter Zajac25-Nov-99 6:56 
QuestionHow to get the caret's position in a richedit? Pin
Thömmi25-Nov-99 0:43
Thömmi25-Nov-99 0:43 
AnswerRE: How to get the caret's position in a richedit? Pin
Dean Edmonds8-Dec-99 13:45
sussDean Edmonds8-Dec-99 13:45 
Generalredirect cerr to a string stream Pin
hhuynh0124-Nov-99 10:01
hhuynh0124-Nov-99 10:01 
GeneralRE: redirect cerr to a string stream Pin
Alex Gorev26-Nov-99 10:24
Alex Gorev26-Nov-99 10:24 
Generalremove scroll bars in Grid Control Pin
Jason24-Nov-99 6:33
Jason24-Nov-99 6:33 
GeneralRE: remove scroll bars in Grid Control Pin
Chris Maunder27-Nov-99 17:04
cofounderChris Maunder27-Nov-99 17:04 
GeneralHtmlHelp in multi-threaded app Pin
Martin Speiser23-Nov-99 21:03
Martin Speiser23-Nov-99 21:03 
GeneralRE: HtmlHelp in multi-threaded app Pin
Member 105424-Nov-99 2:34
Member 105424-Nov-99 2:34 
GeneralRE: RE: HtmlHelp in multi-threaded app Pin
Martin Speiser25-Nov-99 0:50
Martin Speiser25-Nov-99 0:50 
General[Q]Using the MAPI Pin
Member 431523-Nov-99 18:04
Member 431523-Nov-99 18:04 
QuestionMDI custom tile with open/close of childeren? Pin
Michael Peters19-Nov-99 19:45
Michael Peters19-Nov-99 19:45 
AnswerRE: MDI custom tile with open/close of childeren? Pin
Martin Speiser19-Nov-99 23:51
Martin Speiser19-Nov-99 23:51 
1) Write a window class dervied from CWnd.

class MdiClient : public CWnd
{
DECLARE_DYNAMIC( MdiClient )

public:
// Construction/Destruction
MdiClient();

protected:
// ClassWizard generated message map functions
//{{AFX_MSG( MdiClient )
//}}AFX_MSG

afx_msg LRESULT OnMDICreate( WPARAM, LPARAM lParam );
afx_msg LRESULT OnMDIDestroy( WPARAM wParam, LPARAM );

DECLARE_MESSAGE_MAP()

int m_nMDICount;
};

IMPLEMENT_DYNAMIC( MdiClient, CWnd )

// Construction/Destruction
MdiClient::MdiClient()
: m_nMDICount( 0 )
{
}

// ClassWizard generated message map functions
BEGIN_MESSAGE_MAP( CLASS, BASE )
//{{AFX_MSG_MAP( MdiClient )
//}}AFX_MSG_MAP

ON_MESSAGE( WM_MDICREATE, OnMDICreate )
ON_MESSAGE( WM_MDIDESTROY, OnMDIDestroy )

END_MESSAGE_MAP()

LRESULT MdiClient::OnMDICreate( WPARAM, LPARAM lParam )
{
LPMDICREATESTRUCT lpmdic = (LPMDICREATESTRUCT)lParam;
HWND hwndMDIChild = (HWND)CWnd::DefWindowProc( WM_MDICREATE, 0L, (LRESULT)lpmdic );
if ( hwndMDIChild != NULL )
{
++m_nMDICount;
// Reposition the MDI childs like you want
}
return (LRESULT)hwndMDIChild;
}


LRESULT MdiClient::OnMDIDestroy( WPARAM wParam, LPARAM )
{
--m_nMDICount;
if ( m_nMDICount > 0 )
{
// Reposition the MDI childs like you want
}
return CWnd::DefWindowProc( WM_MDIDESTROY, wParam, 0L );
}


2) Derive a class from CMDIFrameWnd, and overwrite OnCreate.

int MdiFrameWnd::OnCreate( LPCREATESTRUCT lpCreateStruct )
{
if( CMDIFrameWnd::OnCreate( lpCreateStruct ) == -1 )
{
return -1;
}

m_pwndMdiClient = new MdiClient;
if( !m_pwndMdiClient->SubclassWindow( m_hWndMDIClient ) )
{
return -1;
}

return 0;
}


HTH

Martin

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.