I've been working on a small library to create Win32-applications in .NET, without using Windows Forms. Yesterday, I was able to run my first demo, which just showed a window. It's not much, but it's incredibly fast.
When compiled in release mode, the Win32 library (TC.Win32.dll) is only 64KB and the demo app is only 16KB!
The library currently only has references to mscorlib.dll and System.dll and via PInvoke also to KERNEL32.DLL and USER32.DLL. The demo app only has references to mscorlib.dll and TC.Win32.dll.
Here's the source code of the demo app:
static class Program
/// The main entry point for the application.
static void Main()
WindowClass lClass = new WindowClass("Test", WindowProcedure);
Window lWindow = Window.Create("Test", "Win32.NET Test", 10, 10, 300, 200, Window.Null, WindowStyles.OverlappedWindow | WindowStyles.Visible, WindowExStyles.Left);
while (Window.Null.GetMessage(out lMessage))
static int WindowProcedure(Window window, WindowMessage message, int wParam, int lParam)
if (message == WindowMessage.Destroy) Window.PostQuitMessage(0);
return window.DefaultWindowProcedure(message, wParam, lParam);