The smallest Windows C program: -
#include <windows.h>
#include "resource.h"
int CALLBACK WinMain(HINSTANCE hApp, HINSTANCE, LPSTR pszCmdLine, int nCmdShow)
{
return DialogBoxParam(hApp,MAKEINTRESOURCE(IDD_DIALOG1),NULL,NULL,NULL);
}
It is assumed that you used the resource editor to create a dialog resource called IDD_DIALOG1. The dialog box will display and close if the Close button is clicked.
source
share