Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

button creation in C++ GUI

#include <Windows.h>

int _tmain(int argc, _TCHAR* argv[])
{
    MSG msg;
    //if you add WS_CHILD flag,CreateWindow will fail because there is no parent window.
    HWND hWnd = CreateWindow(TEXT("button"), TEXT("Easy"), WS_VISIBLE | WS_POPUP,
        10, 10, 80, 25, NULL, NULL, NULL,  NULL);

    ShowWindow(hWnd, SW_SHOW);
    UpdateWindow(hWnd);

    while (GetMessage(&msg, NULL, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return (int) msg.wParam;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #button #creation #GUI
ADD COMMENT
Topic
Name
5+9 =