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

    Window and button question

    I have a question. What I do I create a window like this

    download_window->CreateEx(NULL,AfxRegisterWndClass( CS_VREDRAW | CS_HREDRAW,0,(HBRUSH)GetStockObject( WHITE_BRUSH ),0 ), // class
    " Status", // caption
    WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX, // window style
    0,0,300,100, // dimensions
    NULL, // parent window
    NULL, // menu
    NULL );

    and the button like this:

    CButton myButton1;

    myButton1.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
    CRect(10,10,100,30), download_window, 1);


    I just want to attach my button to the previously created window. I don't know how to do it. The second question how to notify the window that this button was clicked for instance.
    Could you give me a piece of code how to do that?

  2. #2
    Join Date
    Mar 2002
    Location
    Singapore
    Posts
    37

    Cool

    Read the "Programming windows" Chapter 9 -- Child Window Controls.

    I believe you will get what you want!

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