/// <summary> /// Initialize the application on startup. /// </summary> private static void AppInit() { // Somehow this call doesn't make the output visible in cygwin // bash. It works for cmd.exe. KSyscalls.AttachConsole(KSyscalls.ATTACH_PARENT_PROCESS); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MsgWindow = new WmMsgWindow(); KBase.InvokeUiControl = new Control(); KBase.InvokeUiControl.CreateControl(); KBase.HandleErrorCallback = WmUi.HandleError; Application.ThreadException += HandleUnhandledException; KwmCfg.Cur = KwmCfg.Spawn(); KLogging.Logger = KwmLogger.Logger; KwmLogger.SetLoggingLevel(KwmCfg.Cur.KwmDebuggingFlag ? KwmLoggingLevel.Normal : KwmLoggingLevel.Debug); }