好像需要调用CreateWindow,然后要设置其属性为BUTTON。
那么该按钮是否作为一个窗口的子窗口?有没有高手详细地说明一下?

解决方案 »

  1.   

    CreateWindowEx
    第二个参数为 _T("Button")
      

  2.   

    在窗口创建之后:CreateWindowEx(0, _T("BUTTON"), _T("Name"), WS_CHILD|WS_VISIBLE, ……
      

  3.   


    UP这个,按钮还有一个主要的风格就是 BS_PUSHLIKE什么的。
      

  4.   

    MSDN里面不是有很详细的介绍?
      

  5.   


    Creating a Button Outside a Dialog Box
    The following example shows how to use the CreateWindow function
    to create a default push button.
    hwndButton = CreateWindow( 
        "BUTTON",   // predefined class 
        "OK",       // button text 
        WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,  // styles 
     
        // Size and position values are given explicitly, because 
        // the CW_USEDEFAULT constant gives zero values for buttons. 
        10,         // starting x position 
        10,         // starting y position 
        100,        // button width 
        100,        // button height 
        hwnd,       // parent window 父窗口
        NULL,       // No menu 
        (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE), 
        NULL);      // pointer not needed 
      

  6.   

    CreateWindow查msdn吧还是,大家说也说不全