diff options
Diffstat (limited to 'src/mingwMain/kotlin/moe/yuuta/aero/Aero.kt')
-rw-r--r-- | src/mingwMain/kotlin/moe/yuuta/aero/Aero.kt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mingwMain/kotlin/moe/yuuta/aero/Aero.kt b/src/mingwMain/kotlin/moe/yuuta/aero/Aero.kt index c2f6e3d..c1f76de 100644 --- a/src/mingwMain/kotlin/moe/yuuta/aero/Aero.kt +++ b/src/mingwMain/kotlin/moe/yuuta/aero/Aero.kt @@ -7,13 +7,6 @@ import platform.windows.* fun main() { SetProcessDPIAware() val hInstance = GetModuleHandleA(null) - val nCmdShow = memScoped { - val startUpInfo = nativeHeap.alloc<_STARTUPINFOA>() - GetStartupInfoA(startUpInfo.ptr) - val nCmdShow = startUpInfo.wShowWindow - nativeHeap.free(startUpInfo) - return@memScoped nCmdShow.convert<Int>() - } val className = "Main Window Class" @@ -71,6 +64,13 @@ fun main() { 0) } } else { + val nCmdShow = memScoped { + val startUpInfo = nativeHeap.alloc<_STARTUPINFOA>() + GetStartupInfoA(startUpInfo.ptr) + val nCmdShow = startUpInfo.wShowWindow + nativeHeap.free(startUpInfo) + return@memScoped nCmdShow.convert<Int>() + } ShowWindow(hwnd, nCmdShow) msgLoop() } |