This is the same file that the X-specific interface uses, a #ifdef WIN32 in it causes the win32 header portion to be used. Because many of the system-specific calls have the same names (just different argument) you can write interesting "portable" system specific code.
Fltk creates a single WNDCLASSEX called "FLTK". The window class is created the first time Fl_Window::show() is called.
You can probably combine FLTK with other libraries that make their own WIN32 window classes. The easiest way is to call Fl::wait(), it will call DispatchMessage for all messages to the other windows. If necessary you can let the other library take over (as long as it calls DispatchMessage()), but you will have to arrange for the function Fl::flush() to be called regularily so that widgets are updated. Timeouts, the idle function, and file descriptor callbacks will not work in this case.
Notice that fl_window is the window handle. Other information such as the position or size of the window can be found by looking at Fl_Window::current(), which returns a pointer to the Fl_Window being drawn.
window->icon((char*)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON)));
This only works if called before it is shown using the Fl_Window::show() method.
To always get a console window you create a console application (the "/SUBSYSTEM:CONSOLE" option for the linker). This works fine but there is no way to stop Windows from popping up a terminal if you run the program from the GUI.
For a GUI-only application create a WIN32 application (the "/SUBSYSTEM:WINDOWS" option for the linker). FLTK provides a WinMain() function can be overridden by an application and is provided for compatibility with programs written for other operating systems that conform to the ANSI standard entry point main(). This will allow you to build a WIN32 Application without having to change your source files.
Because of problems with the Microsoft Visual C++ header files and/or compiler, you cannot have a WinMain function in a DLL. I don't know why. Thus, this nifty feature is only available if you link to the static library. You may want to compile the souce file fl_call_main.c to a .obj and link it with your program when using the DLL version of fltk.
WIN32 applications without a console cannot write to stdout or stderr, even if they are run from a console window. Any output is silently thrown away. We are not sure why, but we do question the sanity of the software engineers there sometimes. If FLTK is compiled with -DDEBUG then the WinMain will create a console window for your application so you can put printf() statements for debugging or informational purposes.
Cut text contains ^J rather than ^M^J to break lines. This is a feature, not a bug.
The WinMain is a horrid mess and always breaking. This is due to a concentrated effort by MicroSoft to make it impossible to make portable programs without #ifdef statements.