Exemplo n.º 1
0
        private Boolean SetFormToOLEDScreen()
        {
            //LogHelper.Log("Custom getNumberOfConnectedMonitors got " + ScreenHelper.getNumberOfConnectedMonitors());
            var OLED_screen = ScreenHelper.FindScreen(RegistryHelper.LoadScreenName());

            if (OLED_screen != null)
            {
                Point p = new Point();
                p.X           = Screen.PrimaryScreen.Bounds.Location.X;
                p.Y           = Screen.PrimaryScreen.Bounds.Location.Y;
                this.Location = p;
                //LogHelper.Log("Found screen and setting pos " + p.X + " " + p.Y);
                //LogHelper.Log("OLED_screen.Bounds.Width " + OLED_screen.Bounds.Width + " OLED_screen.Bounds.Height " + OLED_screen.Bounds.Height + " OLED_screen.Bounds.Size " + OLED_screen.Bounds.Size);
                //LogHelper.Log("OLED_screen.Bounds.X " + OLED_screen.Bounds.X + " OLED_screen.Bounds.Y " + OLED_screen.Bounds.Y);
                return(true);
            }
            LogHelper.Log("Screen not found");
            return(false);
        }
Exemplo n.º 2
0
        public static Boolean SaveScreenName(String new_name)
        {
            var screen = ScreenHelper.FindScreen(new_name);

            if (screen == null)
            {
                string            message = "The screen name could not be found, are you sure you entered it correctly? Check the Windows display settings to get the proper name.";
                string            caption = "Error While Getting Screen";
                MessageBoxButtons buttons = MessageBoxButtons.OK;
                MessageBox.Show(message, caption, buttons);
            }
            else
            {
                RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\OLEDScreenSaver");
                key.SetValue("ScreenName", new_name);
                key.Close();
                return(true);
            }
            return(false);
        }