$ cat cygmsgbox.cpp #include #include #include int main(int, char **) { int PID = fork(); if (PID) { MessageBox(NULL, "Congratulations, it's a boy!", "Proud parent", MB_OK | MB_ICONINFORMATION ); puts("Parent messagebox closed"); } else { MessageBox(NULL, "Hello, are you my mother?", "New child", MB_OK | MB_ICONINFORMATION ); puts("Child messagebox closed"); } return 0; } $ gcc cygmsgbox.cpp -lstdc++ $ ./a.exe Child messagebox closed Parent messagebox closed