Question

How can I add a pushbutton to resource file in Win32? All examples I found shows how to in Dialog Window or modal, but how about main Window?

I've this sample:

IDD_ABOUT DIALOG DISCARDABLE 0, 0, 239, 66
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
    CAPTION "My About Box"
    FONT 8, "MS Sans Serif"
    BEGIN
    DEFPUSHBUTTON "&OK",IDOK,174,18,50,14 //tried to add this in resource, but unsuccessful
    //more code
END
Was it helpful?

Solution

You need to add the button from the code. Unlike a dialog, window doesn't have its own resource. It uses resources to create menu and icon, but window client area doesn't use any resource.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top