Home * Software * Windows
external image 489px-Windows_logo_and_wordmark_-_2012.svg.png

Windows is a series of 32-bit and 64-bit operating systems by Microsoft for x86 and x86-64 PC's, as well as Windows CE for embedded systems and the mobile operating system Windows Mobile. Its development started in the early 80s as a graphical user interface for 16-bit MS-DOS operating system, with the ability to perform cooperative multitasking while processing an event loop.
Microsoft Windows Logo [1]


external image Image70.jpg

external image Image54.jpg
Windows 1.0, 1985 [2]

Windows/286 2.11, 1987 [3]
external image windowsnt40_screenshot.jpg

external image winvista-final-s-18.gif
Windows NT 4.0 [4]

Windows Vista [5]

Chess Engines

Most current chess engines are suited to run under Windows, a few with its own proprietary user interface, but most common as console application and child process of an external chess GUI communicating via redirected standard streams [6] using protocols like the Chess Engine Communication Protocol (WinBoard) and/or the Universal Chess Interface (UCI).

Windows Chess GUIs


Arena [7]

Deep Sjeng under ChessPartner [8]


Deep Fritz 14 GUI [9]

Deep Rybka 4 Aquarium [10]





Remote Desktop


Covers integrated development environments (IDE), Software development kit (SDK), Application programming interface (API), programming languages, compiler and tools.






Input and Output


Interprocess Communications

Dynamic Linking


C programmers were faced with some new paradigms from early 16-bit Windows API, not to mention the fact that a lot of C standard library functions were hard and error-prone to use, or even taboo [11] . Charles Petzold: "The original hello world program in the Windows 1.0 SDK was a bit of a scandal. HELLO.C was about 150 lines long, and the HELLO.RC resource script had another 20 or so more lines". (...) Veteran C programmers often curled up in horror or laughter when encountering the Windows hello-world program." [12] .

WinMain and the Message loop

Windows programs are event-driven, have no usual main, but WinMain to enter a event loop [13] , where DispatchMessage transfers messages to a callback procedure associated with the window the message refers to, i.e. for keyboard events one window which owns the keyboard focus. To make Windows applications work flawlessly, keeping its windows up to date, that is processing paint messages, the I/O bound GUI thread needs to be run in the message loop, to react on messages best within 20 ms. In early 16-bit Windows, DispatchMessage implemented cooperative multitasking - but one application being uncooperative could made the whole system hang.

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
   MSG msg;
   wc.lpfnWndProc = (WNDPROC) MyWndProc; // associate a Window procedure for this "class" of windows
   if (!RegisterClass(&wc)) // register window class
       return FALSE;
   hwnd = CreateWindow(...);
   ShowWindow(hwnd, SW_SHOW);
   while(GetMessage(&msg, NULL, 0, 0) > 0)
   return msg.wParam;

Window Procedure

The callback or Window procedure is called from the above message loop.
    HWND hwnd,        // handle to window
    UINT uMsg,        // message identifier
    WPARAM wParam,    // first message parameter
    LPARAM lParam)    // second message parameter
    HDC hdc;
    switch (uMsg)
        case WM_CREATE:    // Initialize the window
            return 0;
        case WM_PAINT:
            hdc = BeginPaint(hwnd, &ps);
            TextOut(hdc, 0, 0, "Hello, Windows!", 15);
            EndPaint(hwnd, &ps);
            return 0;
        case WM_DESTROY:   // Clean up window-specific data objects
            return 0;
        case WM_CHAR:      // Process Keyboard character events
            return 0;
        case WM_MOUSEMOVE: // Process mouse move events
            return 0;
        // Process other messages
            return DefWindowProc(hwnd, uMsg, wParam, lParam);
    return 0;

Standard C Library


Microsoft's proprietary C++ Foundation Classes wrapped the handle based Windows API and hides much of its complexity. Still one of the early class libs, it has a lot of ugly macros, i.e. for message maps. Borland's counter part was the Object Windows Library.

Command-Line Applications

Applies for most UCI and/or Chess Engine Communication Protocol (WinBoard) compatible chess engines, relying on an external GUI.

Class Libs


Calling Conventions

Agner Fog describes x86 and x86-64 calling conventions for different C++ compilers and operating systems, covering 32-bit and 64-bit Windows [14] :

The document contains details about data representation, function calling conventions, register usage conventions, name mangling schemes, etc. for many different C++ compilers and operating systems. Discusses compatibilities and incompatibilities between different C++ compilers. Includes information that is not covered by the official Application Binary Interface standards (ABI's). The information provided here is based on my own research and therefore descriptive rather than normative. Intended as a source of reference for programmers who want to make function libraries compatible with multiple compilers or operating systems and for makers of compilers and other development tools who want their tools to be compatible with existing tools.

Other Languages

See also


Forum Posts

1995 ...

2000 ...

2010 ...

2015 ...

Further Links


  1. ^ Microsoft Windows from Wikipedia
  2. ^ Microsoft Windows 1.03 and other tools, 1985 from DigiBarn
  3. ^ Microsoft Windows/286 2.11 and other tools from DigiBarn
  4. ^ Windows NT 4.0 Workstation Betriebssystem
  5. ^ Windows Vista Betriebssystem
  6. ^ Creating a Child Process with Redirected Input and Output, MSDN
  7. ^ Free chess graphical user interface (GUI) Arena for chess engines
  8. ^ Sjeng - chess, audio and misc. software
  9. ^ Deep Fritz 14 from ChessBase
  10. ^ ChessOK, Chess Shop from the Developers of Rybka 3 Aquarium
  11. ^ Standard C Library Functions from MSDN: Microsoft Development
  12. ^ Windows API from Wikipedia - History
  13. ^ Message loop in Microsoft Windows
  14. ^ Calling conventions for different C++ compilers and operating systems (pdf) by Agner Fog
  15. ^ MinGW from Wikipedia

Up one Level