thanks!

解决方案 »

  1.   

    需要创建的时候直接CreateWindow呀,位置自己设定
    Button 的风格是 BS开头的
    Edit的是ES_开头的
    看看msdn CreateWindow函数
      

  2.   

    HWND btnhwnd=CreateWindow(
    "button",  //class name
    "caption",
    BS_PUSHBUTTON, //风格
    x,  //坐标和长 高
    y,
    width,
    height,
    windowhwnd, //父级窗口的HWND,就是这个Button创建在那个窗口里
    NULL,
    NULL,
    NULL,
    )HWND btnhwnd=CreateWindow(
    "edit",  //class name
    "text",
    ES_CENTER, //风格  
    x,  //坐标和长 高
    y,
    width,
    height,
    windowhwnd, //父级窗口的HWND,就是这个Button创建在那个窗口里
    NULL,
    NULL,
    NULL,
    )
    更多详情参见
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindow.asp
      

  3.   

    Yes, use CreateWindow or CreateWindowEx.
    If you want to create a Button, you should give "button" as the 
    class name, similarly create Edit Control with "edit".