·  C – Create – Application – Windows

 

- Info:

  - This tutorial shows how to create "C Windows Application" using different compilers and tools.

  - Windows Application uses GUI - Graphical User Interface based on w.

 

- MinGW Compiler:

  - Create C:\Temp\Temp.c

  - Start MSDOS

  - cd C:\Temp

  - gcc Test.c -o Test.exe

  - Test.exe

 

- Microsoft Compiler:

  - Create C:\Temp\Test.c

  - Start MSDOS

  - cd C:\Temp

  - cl Test.c user32.lib

  - Test.exe

 

- Microsoft Visual Studio 2008:

  - Start MVS 2008 – File – New – Project ... – Visual C++ – General – Empty Project – Name: MyProject – OK

  - RC on Source Files – Add – New Item... – Code – C++ File (.cpp) – Name: Test.c – Add – Paste Test.c

  - RC on Test.c – Properties – Configuration Properties – C/C++ – Advanced – Compile As: Compile as C Code (/TC)

  - Start Without Debugging Ctrl+F5

 

    Test.c

    #include <windows.h>

     

    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int CmdShow) {

       MessageBox(NULL, TEXT("First Program"), TEXT("First"), MB_OK );

       return 0;

    }

 

   

 

- Errors:

  - error C1083: Cannot open include file: 'windows.h'