CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    8

    get the window message?

    Hi,

    If I create a button dynamically with MFC like this:

    RECT r;
    r.bottom = 30;
    r.left = 10;
    r.right = 60;
    r.top = 10;

    pNewButton = new CButton;
    pNewButton->Create("toto",WS_VISIBLE,r,AfxGetMainWnd(),1001);

    and after when i click on the created button, I would like it show a message box. But I don't how to associate the click buttom message with the correct method of the created buttom.

    Thanks



  2. #2
    Join Date
    May 1999
    Posts
    2

    Re: get the window message?

    U should create a CButton derived class for the new button and using Attach function the attach your new button to this CButton derived class.
    eg. CMyButton btn;
    btn.Attach(MyButtonHandle);


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured