The following minimal C/C++ code will create a Windows desktop application. It can build without a resource file and in my test the executable did not contain a manifest or any resources. The application's window looks like this on Win10 22H2 -
![Minimal](https://learn-attachment.microsoft.com/api/attachments/cb2fe453-338c-4f53-ba51-5fcb3a93c51f?platform=QnA)
The code to create the application is -
#include <Windows.h>
#include <stdio.h>
#include <tchar.h>
#define IDC_EXIT 101
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPTSTR lpCommandline, _In_ int nShow)
{
WNDCLASS wc = { 0 };
MSG msg;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wc.lpszClassName = TEXT("MinimalExample");
if (!RegisterClass(&wc))
{
MessageBox(NULL, TEXT("Error registering window class"), TEXT("Error"), MB_ICONERROR | MB_OK);
return 1;
}
HMENU hMenu = CreateMenu();
HMENU h = CreatePopupMenu();
AppendMenu(hMenu, MF_POPUP, (UINT_PTR)h, TEXT("File"));
AppendMenu(h, MF_STRING, (UINT_PTR)IDC_EXIT, TEXT("Exit"));
HWND hwnd = CreateWindow(TEXT("MinimalExample"), TEXT("Minimal Example"), WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 400, 300, NULL, hMenu, hInstance, NULL);
if (!hwnd)
{
MessageBox(NULL, TEXT("Wndow Creation Failed"), TEXT("Error"), MB_ICONERROR | MB_OK);
return 1;
}
ShowWindow(hwnd, nShow);
UpdateWindow(hwnd);
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int)msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_COMMAND:
{
switch (LOWORD(wParam))
{
case IDC_EXIT:
DestroyWindow(hwnd);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
}
break;
case WM_PAINT:
{
PAINTSTRUCT ps;
BeginPaint(hwnd, &ps);
EndPaint(hwnd, &ps);
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}