Pelles C forum

C language => User contributions => Topic started by: Vortex on November 24, 2026, 07:16:13 PM

Title: Very small C run-time startup module
Post by: Vortex on November 24, 2026, 07:16:13 PM
Here is an example of a very small C run-time startup module if command line parameters can be omitted.

#include <windows.h>

extern int __stdcall WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd);

int __cdecl WinMainCRTStartup(void)

{
    ExitProcess(WinMain(GetModuleHandle(NULL),NULL,NULL,SW_SHOWDEFAULT));
}