StephaneLenclud@189: // StephaneLenclud@193: // Copyright (C) 2014-2016 Stéphane Lenclud. StephaneLenclud@189: // StephaneLenclud@189: // This file is part of SharpDisplayManager. StephaneLenclud@189: // StephaneLenclud@189: // SharpDisplayManager is free software: you can redistribute it and/or modify StephaneLenclud@189: // it under the terms of the GNU General Public License as published by StephaneLenclud@189: // the Free Software Foundation, either version 3 of the License, or StephaneLenclud@189: // (at your option) any later version. StephaneLenclud@189: // StephaneLenclud@189: // SharpDisplayManager is distributed in the hope that it will be useful, StephaneLenclud@189: // but WITHOUT ANY WARRANTY; without even the implied warranty of StephaneLenclud@189: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the StephaneLenclud@189: // GNU General Public License for more details. StephaneLenclud@189: // StephaneLenclud@189: // You should have received a copy of the GNU General Public License StephaneLenclud@189: // along with SharpDisplayManager. If not, see . StephaneLenclud@189: // StephaneLenclud@189: StephaneLenclud@189: using System; StephaneLenclud@189: using System.Collections.Generic; StephaneLenclud@189: using System.Linq; StephaneLenclud@189: using System.Threading.Tasks; StephaneLenclud@189: using System.Windows.Forms; StephaneLenclud@189: using System.Drawing; StephaneLenclud@189: StephaneLenclud@225: namespace SharpDisplayClientIdle StephaneLenclud@189: { StephaneLenclud@225: public static class Program StephaneLenclud@189: { StephaneLenclud@189: /// StephaneLenclud@189: /// The main entry point for the application. StephaneLenclud@189: /// StephaneLenclud@189: [STAThread] StephaneLenclud@189: static public void Main() StephaneLenclud@189: { StephaneLenclud@189: //Set high priority to our process to avoid lags when rendering to our screen StephaneLenclud@189: System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal; StephaneLenclud@189: StephaneLenclud@189: Application.EnableVisualStyles(); StephaneLenclud@189: Application.SetCompatibleTextRenderingDefault(false); StephaneLenclud@191: Application.Run(new FormClientIdle()); StephaneLenclud@189: } StephaneLenclud@189: StephaneLenclud@189: [STAThread] StephaneLenclud@225: public static void MainWithParams(object aParams) StephaneLenclud@189: { StephaneLenclud@189: //Set high priority to our process to avoid lags when rendering to our screen StephaneLenclud@189: System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal; StephaneLenclud@189: StephaneLenclud@189: Application.EnableVisualStyles(); StephaneLenclud@189: Application.SetCompatibleTextRenderingDefault(false); StephaneLenclud@191: FormClientIdle form = new FormClientIdle(); StephaneLenclud@189: form.Params = (StartParams)aParams; StephaneLenclud@193: form.WindowState = FormWindowState.Minimized; StephaneLenclud@193: form.ShowInTaskbar = false; StephaneLenclud@189: Application.Run(form); StephaneLenclud@189: } StephaneLenclud@189: StephaneLenclud@189: } StephaneLenclud@189: StephaneLenclud@189: public class StartParams StephaneLenclud@189: { StephaneLenclud@189: public StartParams(Point aLocation, string aTopText = "", string aBottomText = "") StephaneLenclud@189: { StephaneLenclud@189: TopText = aTopText; StephaneLenclud@189: BottomText = aBottomText; StephaneLenclud@189: Location = aLocation; StephaneLenclud@189: } StephaneLenclud@189: StephaneLenclud@189: public string TopText { get; set; } StephaneLenclud@189: public string BottomText { get; set; } StephaneLenclud@189: public Point Location { get; set; } StephaneLenclud@189: } StephaneLenclud@189: }