回 帖 发 新 帖 刷新版面

主题:请问WINDOWS API函数怎么创建一个BUTTON啊``谢谢``

如题```多谢``

回复列表 (共3个回复)

沙发

放在消息语句块下面。。

WM_COMMAND

板凳

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

3 楼

汗~! 还真。。

我来回复

您尚未登录,请登录后再回复。点此登录或注册