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 procedureassociated 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 boundGUIthread 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){
WNDCLASS wc;
MSG msg;
...
wc.lpfnWndProc=(WNDPROC) MyWndProc;// associate a Window procedure for this "class" of windowsif(!RegisterClass(&wc))// register window classreturn FALSE;
hwnd = CreateWindow(...);
ShowWindow(hwnd, SW_SHOW);while(GetMessage(&msg, NULL, 0, 0)>0){
TranslateMessage(&msg);
DispatchMessage(&msg);}return msg.wParam;}
Window Procedure
The callback or Window procedure is called from the above message loop.
LRESULT CALLBACK MyWndProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam)// second message parameter{
PAINTSTRUCT ps;
HDC hdc;switch(uMsg){case WM_CREATE:// Initialize the windowreturn0;case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
TextOut(hdc, 0, 0, "Hello, Windows!", 15);
EndPaint(hwnd, &ps);return0;case WM_DESTROY:// Clean up window-specific data objectsreturn0;case WM_CHAR:// Process Keyboard character eventsreturn0;case WM_MOUSEMOVE:// Process mouse move eventsreturn0;// Process other messagesdefault:return DefWindowProc(hwnd, uMsg, wParam, lParam);}return0;}
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.
Table of Contents
Versions
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
Applications
Major
Microsoft Word
Microsoft Excel
Microsoft PowerPoint
Accessories
Entertainment
Taipei by David Norris
Ziggurat by David Norris
Remote Desktop
Remote Desktop Services, MSDN
Development
Covers integrated development environments (IDE), Software development kit (SDK), Application programming interface (API), programming languages, compiler and tools.IDE
Visual Studio 2010, MSDN
Eclipse.org home
Frameworks
Common Language Runtime Overview, MSDN
Windows Communication Foundation from Wikipedia
Subsystems
SDK
API
Input and Output
Memory
Interprocess Communications
Dynamic Linking
Dynamic-Link Libraries, MSDN
The End of DLL Hell, MSDN
C
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.Window Procedure
The callback or Window procedure is called from the above message loop.Standard C Library
C++
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
MFC Reference, MSDN
Compiler
Visual C++ Tutorials, Library, and More on MSDN
MinGW - Minimalist GNU for Windows
Cygwin Information and Installation
Intel® Compilers
Intel(R) C++ Compiler User and Reference Guides covers Intrinsics » x86, x86-64, MMX, SSE2, SSSE3, SSE4, AVX
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
Publications
Forum Posts
1995 ...
2000 ...
2010 ...
2015 ...
Further Links
References
Up one Level