# Specific reason for using WinMain instead of main?

**URL:** <https://discourse.slicer.org/t/specific-reason-for-using-winmain-instead-of-main/45235>\
**Category:** Development\
**Created:** [November 26, 2025, 10:56am UTC](https://discourse.slicer.org/t/specific-reason-for-using-winmain-instead-of-main/45235 "2025-11-26T10:56:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![codeling](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/codeling/32/81200_2.png) [@codeling](https://discourse.slicer.org/u/codeling)\
**Post date:** [November 26, 2025, 10:56am UTC](https://discourse.slicer.org/t/specific-reason-for-using-winmain-instead-of-main/45235/1 "2025-11-26T10:56:02Z")

</div>

I just discovered that Slicer is using `int __stdcall WinMain(…)` on Windows (basically since forever, as far as I can tell).

From what I can tell, WinMain is just a wrapper making it easier _for Windows-targeted development_; one could just as well use the standard `int main(…)`instead, such as [the official Qt examples do](https://code.qt.io/cgit/qt/qtbase.git/tree/examples/widgets/mainwindows/menus/main.cpp?h=6.10). Since this would simplify code quite a bit - basically [all Windows-specific code in qSlicerApplicationMainWrapper.cxx](https://github.com/Slicer/Slicer/blob/main/Base/QTApp/qSlicerApplicationMainWrapper.cxx#L24-L51) could be removed - is there a specific reason why `WinMain` should be kept?
