Catch WM_SIZE



Hi,

How to catch the WM_SIZE message of a control created dynamically.
I mean :

BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();

// m_MyControl derived from CWND
m_MyControl.Create( NULL, _T(""), WS_VISIBLE, CRect(10, 10, 0, 0), this,
1 );
}

LRESULT CMyDialog::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_SIZE : // Catch this message but when it is m_MyControl
that is resizing.
}
}

Regards,
.



Relevant Pages

  • Re: Windowless control draws wrongly in IE
    ... the poly-line is meant to draw under the cursor tip and I think the ... LRESULT CGestCtl::OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, ... LRESULT CGestCtl::OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& ... HBRUSH hOldBrush, hBrush; ...
    (microsoft.public.vc.atl)
  • Re: problem with PostMessage
    ... LRESULT C_Dialog::OnAddString(WPARAM WParam) ... LRESULT C_Dialog::OnAddString(WPARAM wParam, LPARAM lParam) ... You are using sizeof on a pointer, so it always returns 4 on 32-bit ...
    (microsoft.public.vc.mfc)
  • Re: Exceptions and ATL
    ... > static INT_PTR CALLBACK DialogProc(HWND hWnd, UINT uMsg, WPARAM ... > wParam, LPARAM lParam) ... CDialogImpl::DialogProc is indeed not exception safe. ... DestroyWindow from inside the message handler of the same window, ...
    (microsoft.public.vc.atl)
  • Re: ATL TrackBar Transparent
    ... LRESULT OnCtlColorStatic(UINT, WPARAM wParam, LPARAM lParam, BOOL&) ... a pattern brush out of this bitmap and return it. ...
    (microsoft.public.vc.atl)
  • Re: How do I receive WM_INPUT in an MFC app?
    ... The handler function will be as shown (be sure to declare it in the header file) ... LRESULT CMyMainDlg::OnInput(WPARAM wParam, LPARAM lParam) ...
    (microsoft.public.vc.mfc)