EXTERN_C IMAGE_DOS_HEADER __ImageBase;
before implementation of your form class, add following three lines of code into form constructor. HICON icon{ LoadIcon((HINSTANCE)&__ImageBase, MAKEINTRESOURCE(MAINICON)) }; // Load icon from resource(you also may load icon from file)
SendMessage((HWND)QueryService()->getWindow()->QueryService()->getHandle(), WM_SETICON, ICON_BIG, (LPARAM)icon); // Set form's window icon
SendMessage((HWND)QueryService()->getWindow()->QueryService()->getHandle(), WM_SETICON, ICON_SMALL, (LPARAM)icon);
Linux and Linux-derived __linux__
Android __ANDROID__ (implies __linux__)
Linux (non-Android) __linux__ && !__ANDROID__
Darwin (Mac OS X and iOS) __APPLE__
Akaros (http://akaros.org) __ros__
Windows _WIN32
Windows 64 bit _WIN64 (implies _WIN32)
NaCL __native_client__
AsmJS __asmjs__
Fuschia __Fuchsia__
Visual Studio _MSC_VER
gcc __GNUC__
clang __clang__
emscripten __EMSCRIPTEN__ (for asm.js and webassembly)
MinGW 32 __MINGW32__
MinGW-w64 32bit __MINGW32__
MinGW-w64 64bit __MINGW64__