Re: Catch WM_SIZE



Catching the WM_SIZE for a control is the same for a dynamically created
control and a contorl on the dialog template.

Generally you would catch the WM_SIZE message in the control itself. So you
will have to catch the WM_SIZE in the class of m_MyControl.

What type of control is m_MyControl? What does it inherite from?

AliR.

"Erakis" <Erakis@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5BC2F5F0-D19B-4B3E-9881-EAC6B5000B32@xxxxxxxxxxxxxxxx
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

  • Atl composite control Display of Control Problem
    ... I have created an ATL composite control and added a list box in it. ... LRESULT OnWindowPosChanging(UINT uMsg, WPARAM wParam, LPARAM lParam, ... "visibledlg" to true. ...
    (microsoft.public.vc.atl)
  • Re: Creating a CStatic object in CDialog - newbie problem
    ... I tried your suggestion but it was unsuccessful. ... AfxWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam) ... > I suspect that the problem is that you're creating a control ...
    (microsoft.public.windowsce.embedded.vc)
  • CStatic - OwnerDraw Performance Problems
    ... Basically the performance is awful when I owner draw. ... I want to use them to do some additional formatting like changing color and underlining them (the whole control not just the text). ... LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) ...
    (microsoft.public.vc.mfc)
  • RE: Debug Assertion in CWindowImplBaseT. Exception in Relese build [PSC]
    ... In the IDE it breaks on an unhandled exception when the assert is removed and a return S_OK is performed. ... This occurs with just a single button control on a form with a click event that unloads the VB form. ... static LRESULT CALLBACK MyWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, ... LPARAM lParam) ...
    (microsoft.public.vc.atl)
  • HELP !!! Managed C++, WinForms and ATL !!!
    ... LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& ... WinForms user control. ... ATL based host for WinForm control. ...
    (microsoft.public.dotnet.framework)

Loading