WinAPI Wrapper

[icon] About the WinAPI Wrapper Library

The WinAPI Wrapper library is a C++ class library that enhances the Win32 API with C++ functionality. It is not an equivalent of MFC. Although it can be used instead of MFC, it can also be used along with regular C Win32 API or with MFC in the same application.

The library contains miscellaneous classes that simplify writing Windows applications. Most of the classes' functions are inline and do not impose any extra overhead; you could achieve the same code with the regular C Win32 API, but with the WinAPI Wrapper library it is just simplier.

The library currently has classes for windows, standard and common controls, GDI objects, device contexts, files, file mappings, file finding, image lists, registry keys, threads and synchronization objects, certain common dialogs, menus, sockets, etc.

As of now, you can take the source code of the library and use it for whatever purpose you want. You're only not allowed to redistribute the modified version.

Download Download (version 1.05)

[icon] Example

Here is a simple example, a typical Hello World! application written using the WinAPI Wrapper.

// Include Wrapper's header
#include <winapi.h>

// Make the WinAPI namespace local
using namespace WinAPI;

// Main window class
class MainWindow: public Window {
public:
    // Create the window
    MainWindow() {
        Create( "Example App" );
    }
    // WM_DESTROY - quit application
    virtual void OnDestroy() {
        PostQuitMessage( 0 );
    }
    // WM_PAINT - paint sample text
    virtual void OnPaint() {
        PaintDC dc( *this );
        dc.TextOut( WPoint(50,50),
            "Hello, World!" );
    }
};

namespace {
    // The application object
    Application< MainWindow > app;
}