Simple Win32 program
//naziv fajla hmm.c
//kompajler gcc
 
#include <windows.h>
 
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
    LPSTR lpCmdLine, int nCmdShow)
{
    MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK);
    return 0;
}

WinMain() je Windows ekvivalent za main() funkciju (DOS ili UNIX). Pokretanjem ove funkcije pocinje izvrsavanje naseg programa.

Parametri koje smo prosledili WinMain funkciji su sledeci :

HINSTANCE hInstance
Handle na izvrsni fajl programa (.exe fajl u memoriji).

HINSTANCE hPrevInstance
Nandle na instancu programa (Uvek NULL za Win32 programe).

LPSTR lpCmdLine
Argumenti komandne linije kao string (Ne ukljucujuci ime programa).

int nCmdShow
Integer vrednost koja moze biti prosledjena funkciji ShowWindow().

Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.