void Bingo_FormClosing(object sender, FormClosingEventArgs e) { //switch back to original res. bool tmpSuccess = false; Resolution.CResolution ChangeRes = new Resolution.CResolution(tempWidth, tempHeight, ref tmpSuccess); }
static void SystemEvents_DisplaySettingsChanged(object sender, EventArgs e) { if (!System.Windows.Forms.SystemInformation.TerminalServerSession) { Resolution.CResolution ChangeRes = new Resolution.CResolution(width, hight, frequency); } }
private void MainP_Load(object sender, EventArgs e) { XmlDocument xmlDoc = new XmlDocument(); try { xmlDoc.Load("options.xml"); XmlNodeList res = xmlDoc.GetElementsByTagName("resolution1"); string resolutionStr = res[0].InnerText; IList <string> resolution = resolutionStr.Split('x'); string H = resolution[0].ToString(); string W = resolution[1].ToString(); Resolution.CResolution ChangeRes = new Resolution.CResolution(Convert.ToInt32(H), Convert.ToInt32(W)); if (Screen.AllScreens.Length > 1) { res = xmlDoc.GetElementsByTagName("resolution2"); resolutionStr = res[0].InnerText; resolution = resolutionStr.Split('x'); H = resolution[0].ToString(); W = resolution[1].ToString(); Resolution.SECResolution ChangeSECRes = new Resolution.SECResolution(Convert.ToInt32(H), Convert.ToInt32(W)); } } catch (Exception msg) { MessageBox.Show("Some error occurred, please try again" + " " + msg.ToString()); } this.Close(); }
private void button4_Click(object sender, EventArgs e) { MessageBox.Show("Resolution is going to change to " + "max" + " X " + "max"); Resolution.CResolution ChangeRes = new Resolution.CResolution(); DEVMODE1 dm1 = ChangeRes.getCurrentResolution(); DEVMODE1 dm = ChangeRes.getMaximumSupportedResolution(); List <DEVMODE1> RL = ChangeRes.getSupportedResolutionList(); for (int i = 0; i < RL.Count; i++) { Console.WriteLine("\t" + "{0} by {1}, " + "{2} bit, " + "{3} degrees, " + "{4} hertz," + "{5} color", RL[i].dmPelsWidth, RL[i].dmPelsHeight, RL[i].dmBitsPerPel, RL[i].dmDisplayOrientation * 90, RL[i].dmDisplayFrequency, RL[i].dmYResolution); } ChangeRes.setSupportedResolution(RL[RL.Count - 1]); }
private void test() { FixHeight = 1280; FixWidth = 1024; Resolution.CResolution ChangeRes1024 = new Resolution.CResolution(FixHeight, FixWidth); }
public Form1() { InitializeComponent(); GlobalEventProvider actHook = new GlobalEventProvider(); ClientSize = new Size(w, h); Srn = Screen.PrimaryScreen; tempHeight = Srn.Bounds.Width; tempWidth = Srn.Bounds.Height; Resolution.CResolution ChangeRes = new Resolution.CResolution(FixHeight, FixWidth); Cursor.Hide(); folder_check(); recyclebin_desktop_area.Visible = false; Rectangle r = new Rectangle(0, 0, defaultaccountpic.Width, defaultaccountpic.Height); GraphicsPath gp = new GraphicsPath(); int d = 15; gp.AddArc(r.X, r.Y, d, d, 180, 90); gp.AddArc(r.X + r.Width - d, r.Y, d, d, 270, 90); gp.AddArc(r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90); gp.AddArc(r.X, r.Y + r.Height - d, d, d, 90, 90); recyclebin_desktop_area.Location = new Point(recyclebin_desktop_icon.Size.Width - 20, recyclebin_desktop_icon.Size.Height - 10); recyclebin_desktop_text.Location = new Point(recyclebin_desktop_icon.Location.X / 2 + 5, recyclebin_desktop_icon.Location.Y + 50); defaultaccountpic.Region = new Region(gp); defaultaccountpic.Click += new EventHandler(loginUser); defaultaccountlabel.Click += new EventHandler(loginUser); start.Click += new EventHandler(start_Click); start.MouseHover += new EventHandler(start_Hover); start.MouseLeave += new EventHandler(start_MouseLeave); taskbar.Click += new EventHandler(start_close); defaultbackground.Click += new EventHandler(start_clickoff); clock_tick.Tick += new EventHandler(clock_Tick); clock_tick.Interval = 1; startmenu_shutdownbutton.Click += new EventHandler(startmenu_shutdownbutton_Click); startmenu_shutdownbutton.MouseEnter += new EventHandler(startmenu_shutdownbutton_MouseEnter); startmenu_shutdownbutton.MouseLeave += new EventHandler(startmenu_shutdownbutton_MouseLeave); actHook.KeyDown += new KeyEventHandler(hotkey_handler); recyclebin_desktop_area.Click += new EventHandler(recyclebin_desktop_Click); recyclebin_desktop_area.DoubleClick += new EventHandler(recyclebin_desktop_DoubleClick); recyclebin_desktop_icon.Click += new EventHandler(recyclebin_desktop_Click); recyclebin_desktop_icon.DoubleClick += new EventHandler(recyclebin_desktop_DoubleClick); recyclebin_desktop_text.Click += new EventHandler(recyclebin_desktop_Click); recyclebin_desktop_text.DoubleClick += new EventHandler(recyclebin_desktop_DoubleClick); defaultbackground.Click += new EventHandler(deselect_desktop_icons); loginshutdown.Click += new EventHandler(login_shutdownbutton_Click); loginshutdown.Visible = false; boot(); }
public override void Run(TestContainer container) { try { //* add for IsExecuteCommand start if (!base.IsCommandContinue(container)) { this.PassTest = true; this.SkipTest = true; return; } //* add for IsExecuteCommand end int FixHeight = int.Parse(base.GetParameter("FixHeight")); int FixWidth = int.Parse(base.GetParameter("FixWidth")); Resolution.CResolution ChangeRes = new Resolution.CResolution(FixWidth, FixHeight); this.PassTest = true; //* add for output and IsExpectedFail start this.Output = base.GetOutPut(this.Output.Key, this.Output, this.PassTest); //* add for output and IsExpectedFail end //* add for output and IsExpectedFail start this.PassTest = GetTestPassExpected(this.PassTest); //* add for output and IsExpectedFail end //*add for ScreenShot start if (!this.PassTest) { base.CommandFailScreenShot(container); } //*add for ScreenShot end } catch (Exception ex) { //*add for ScreenShot start base.CommandFailScreenShot(container); //*add for ScreenShot end throw ex; } }
private void restoreSavedResBtn_Click(object sender, EventArgs e) { XmlDocument xmlDoc = new XmlDocument(); try { xmlDoc.Load("options.xml"); XmlNodeList res = xmlDoc.GetElementsByTagName("resolution"); string resolutionStr = res[0].InnerText; resolutionStr = resolutionStr.Replace("by", ","); IList <string> resolution = resolutionStr.Split(',').ToList <string>(); string H = resolution[0].ToString(); string W = resolution[1].ToString(); Resolution.CResolution ChangeRes1024 = new Resolution.CResolution(Convert.ToInt32(H), Convert.ToInt32(W)); } catch { MessageBox.Show("Some error occurred, please try again"); } }
static void Main(string[] args) { string mutex_id = "MY_APP"; using (Mutex mutex = new Mutex(false, mutex_id)) { if (!mutex.WaitOne(0, false)) { MessageBox.Show("Instance Already Running!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); return; } else { IntPtr hwnd; hwnd = GetConsoleWindow(); ShowWindow(hwnd, SW_HIDE); } try { //reading the config file and saving it content to a variable using (System.IO.StreamReader file = new System.IO.StreamReader(exePath + "\\config.cfg")) { resolution = file.ReadLine(); } } catch (Exception e) { MessageBox.Show(e.Message); } //if unable to read the config file, there's no point to continue... if (string.IsNullOrEmpty(resolution)) { MessageBox.Show("Can't read config.cfg file !\nClosing... "); isFatalErrorFound = true; } if (!isFatalErrorFound) { string[] dim = resolution.Split(' '); int.TryParse(dim[0], out width); int.TryParse(dim[1], out hight); int.TryParse(dim[2], out frequency); if (width < 640 || hight < 480) { MessageBox.Show("Invaild resolution detected !\nClosing... "); isFatalErrorFound = true; } } //the config file content is readable, so start the event if (!isFatalErrorFound) { Resolution.CResolution ChangeRes = new Resolution.CResolution(width, hight, frequency); // Set the SystemEvents class to receive event notification when a user // preference changes, the palette changes, or when display settings change. SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged); } } Console.Read(); }
private void restoreSavedResBtn_Click(object sender, EventArgs e) { XmlDocument xmlDoc = new XmlDocument(); try { xmlDoc.Load("options.xml"); XmlNodeList res = xmlDoc.GetElementsByTagName("resolution"); string resolutionStr = res[0].InnerText; resolutionStr = resolutionStr.Replace("by", ","); IList<string> resolution = resolutionStr.Split(',').ToList<string>(); string H = resolution[0].ToString(); string W = resolution[1].ToString(); Resolution.CResolution ChangeRes1024 = new Resolution.CResolution(Convert.ToInt32(H), Convert.ToInt32(W)); } catch { MessageBox.Show("Some error occurred, please try again"); } }
//public void parseGameSettingsData() //{ // // Commented temporarly by EG // try // { // if (gameSettings.data != "") // { // // parse the nData into variables // string[] parts = gameSettings.data.Split(','); // if (parts.Length != 17) // { // throw new Exception("Invalid number of parameters in settings.data string(" // + parts.Length.ToString() + ", should be 17)"); // } // maxCardDisplayMode = int.Parse(parts[0]); // bPPatternIndex = int.Parse(parts[1]); // bPPatternCount = int.Parse(parts[2]); // bPPercent = double.Parse(parts[3]); // bPSeed = decimal.Parse(parts[4]); // levelInfo[0].POSetNum = int.Parse(parts[5]); // levelInfo[1].POSetNum = int.Parse(parts[6]); // levelInfo[2].POSetNum = int.Parse(parts[7]); // levelInfo[3].POSetNum = int.Parse(parts[8]); // levelInfo[0].costMulti = int.Parse(parts[9]); // levelInfo[1].costMulti = int.Parse(parts[10]); // levelInfo[2].costMulti = int.Parse(parts[11]); // levelInfo[3].costMulti = int.Parse(parts[12]); // levelInfo[0].prizeMulti = int.Parse(parts[13]); // levelInfo[1].prizeMulti = int.Parse(parts[14]); // levelInfo[2].prizeMulti = int.Parse(parts[15]); // levelInfo[3].prizeMulti = int.Parse(parts[16]); // } // else // { // string tmpErr = "This Game has not been configured by the POS, can not continue!"; // logError(tmpErr); // MessageBox.Show(tmpErr); // Application.Exit(); // } // } // catch (Exception ex) // { // string tmpErr = "Invalid Data String in GameSettings, " + ex.Message; // logError(tmpErr); // MessageBox.Show(tmpErr); // Application.Exit(); // } //} /// <summary> /// constructor /// </summary> /// <param name="standAlone">run in standalone mode.. no db connection required</param> public Bingo(string[] args) { singleton = this; // hide the cursor //Cursor.Hide(); // new generic gameSettings data this.FormClosing += new FormClosingEventHandler(Bingo_FormClosing); Screen Srn = Screen.PrimaryScreen; tempWidth = Srn.Bounds.Width; tempHeight = Srn.Bounds.Height; StartScreen stScr = new StartScreen(); System.Console.WriteLine("OSVersion: {0}", Environment.OSVersion.ToString()); isXP = (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor <= 1); if (isXP) { FixWidth = 1366; } stScr.Show(); if (!(args.Length > 3 && args[3] == "NR")) { //try to change resolution... bool success = false; int i = 0; do { if (i >= resArray.Length) { MessageBox.Show("None of resolutions worked for this hardware..."); Application.Exit(); return; } Resolution.CResolution ChangeRes = new Resolution.CResolution(resArray[i].X, resArray[i].Y, ref success); i++; }while (!success); } moneySymbol = String.Format("{0:C}", 1.00f); moneySymbol = moneySymbol.Substring(0, moneySymbol.IndexOf("1")); terminalID = GameCore.Utility.Functions.GetMachineID(); string tmpStartupPath = Application.StartupPath; FileSearch.SetStartingSearchDirectory(tmpStartupPath + "\\Media\\"); string tmpErr = ""; //PARSE COMMAND LINE ARGS int commandLinePIN = 0; string webServiceAddress = ""; if (args.Length >= 3) { if (args[1].Contains("http")) { webServiceAddress = args[1].ToString(); } else { tmpErr = "Invalid command line WEB Service Address: " + args[1].Trim() + ", terminating Program!"; Logger.Log(tmpErr); Bingo.singleton.CloseApplication(tmpErr); return; } // get the installed Game ID from the command line try { commandLinePIN = int.Parse(args[0].Trim()); } catch { tmpErr = "Invalid command line PIN: " + args[0].Trim() + ", terminating Program!"; Logger.Log(tmpErr); commandLinePIN = 0; Bingo.singleton.CloseApplication(tmpErr); return; } } else { tmpErr = "Invalid command line Params, terminating Program!"; Logger.Log(tmpErr); Bingo.singleton.CloseApplication(tmpErr); return; } //=============================== global::BreakTheBankTabs1063.Properties.Settings.Default.MagicTouchTabs1034_WEBService_Service = webServiceAddress; // ******* CONNECT TO THE DATABASE... *********************** // CONNECT TO DATABASE SERVICE if (service == null) { int tries = 0; while (tries < 5) { service = new WEBService.Service(); if (service != null) { service.Timeout = 10000; break; } Logger.Log("Attempt to connect to WEB Service #" + tries.ToString() + " failed!"); tries++; } if (service == null) { Logger.Log("ALL Attempts to connect to WEB Service failed, Closing Application!"); Bingo.singleton.CloseApplication("Error Connecting to WEB Service"); } } try { // sync with server date and time setLocalTime.SYSTEMTIME tmpTime = new setLocalTime.SYSTEMTIME(); tmpTime.FromDateTime(service.getServerDateTime()); setLocalTime.SetLocalTime(ref tmpTime); } catch (Exception ex) { tmpErr = "Exception connecting to WEB Service calling 'service.getServerDateTime()' " + "Possibly Launcher passed incorrect WEB Service Address, CANNOT CONTINUE!\n\r" + ex.Message; Logger.Log(tmpErr); Bingo.singleton.CloseApplication(tmpErr); return; } // get the EGM status curEGMData = service.getMachineStatus(terminalID.ToString()); // get serial number from command line serialNum = args[2]; curEGMData.serialNum = serialNum; if (curEGMData.terminalID == "0") { // could not get just created EGMTerminals record tmpErr = service.lastError(); if (tmpErr == "") { tmpErr = "Could not get EGMTerminals record for this Unit (TerminalID = " + terminalID.ToString() + "), terminating Program!"; } logError(tmpErr); Bingo.singleton.CloseApplication(tmpErr); return; } // now get the system settings settings = service.getSettings(); gameSettings = service.getGameSettings(gameSystemID); //parseGameSettingsData(); // now get command line PIN data if (commandLinePIN == settings.demoPIN) { usingDemoPIN = true; curPIN.PIN = settings.demoPIN; curPIN.balance = settings.demoAmt; curPIN.playing = true; curPIN.playingAt = curEGMData.terminalID; curPIN.transactionID = 0; curPIN.netSeconds = (int)Math.Round((settings.demoAmt * 100) / settings.penniesPerMinute); curPIN.winBalance = 0M; } else { curPIN = service.getPINData(commandLinePIN); ////////////////////////////////////////////////////////////////////// // curPIN.netSeconds = 0; // curPIN.winBalance = 0M; //////////////////////////////////////////////////////////////////// if (curPIN.PIN == 0) { // command line PIN not found tmpErr = service.lastError(); if (tmpErr == "") { tmpErr = "Could not get PINs record for PIN " + commandLinePIN.ToString() + ", can not continue!"; } logError(tmpErr); Bingo.singleton.CloseApplication(tmpErr); return; } } guiManager = new GuiManager(); // frmWinVerification = new WinVerification(); // Logger.Log("Finished 'Bingo(string[] args)'"); }
private void Button2_Click(object sender, EventArgs e) { //Restore-ScreenResolution Resolution.CResolution n = new Resolution.CResolution(myForms.oldWidth,myForms.oldHeight); System.Threading.Thread.Sleep(500); System.Environment.Exit(0); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { Resolution.CResolution ChangeRes = new Resolution.CResolution(tempHeight, tempWidth); }
private void button2_Click(object sender, System.EventArgs e) { MessageBox.Show("Resolution is going to change to " + FixHeight.ToString() + " X " + FixWidth.ToString()); Resolution.CResolution ChangeRes = new Resolution.CResolution(FixHeight, FixWidth); }
private void MainP_Load(object sender, EventArgs e) { XmlDocument xmlDoc = new XmlDocument(); try { xmlDoc.Load("options.xml"); XmlNodeList res = xmlDoc.GetElementsByTagName("resolution1"); string resolutionStr = res[0].InnerText; IList<string> resolution = resolutionStr.Split('x'); string H = resolution[0].ToString(); string W = resolution[1].ToString(); Resolution.CResolution ChangeRes = new Resolution.CResolution(Convert.ToInt32(H), Convert.ToInt32(W)); if (Screen.AllScreens.Length > 1) { res = xmlDoc.GetElementsByTagName("resolution2"); resolutionStr = res[0].InnerText; resolution = resolutionStr.Split('x'); H = resolution[0].ToString(); W = resolution[1].ToString(); Resolution.SECResolution ChangeSECRes = new Resolution.SECResolution(Convert.ToInt32(H), Convert.ToInt32(W)); } } catch (Exception msg) { MessageBox.Show("Some error occurred, please try again" + " " + msg.ToString()); } this.Close(); }
private void button1_Click(object sender, System.EventArgs e) { // change each screen's resolution to newWidth x newHeight foreach (Screen display in Screen.AllScreens) { MessageBox.Show("Resolution of " + display.DeviceName + " is going to change to " + newWidth.ToString() + "x" + newHeight.ToString()); Resolution.CResolution ChangeRes = new Resolution.CResolution(newWidth, newHeight, display); } }
private void MainForm_Load(object sender, EventArgs e) { // change resolution to 1024 × 768 Screen myScreen = Screen.PrimaryScreen; myForms.oldHeight = myScreen.Bounds.Height; myForms.oldWidth = myScreen.Bounds.Width; Resolution.CResolution n = new Resolution.CResolution(1024, 768); // Loggin //DemoHere LoadCompanySettings(); if (myForms.logedIn == false) { myForms.myLoginForm = new LoginForm(); myForms.myLoginForm.ShowDialog(); } else { myForms.myMainForm.UpdatePermissions(); } }
private void button3_Click(object sender, System.EventArgs e) { MessageBox.Show("Resolution is going to change to "+tempHeight.ToString()+" X "+tempWidth.ToString()); Resolution.CResolution ChangeRes=new Resolution.CResolution(tempHeight,tempWidth); }
public void RetainResolution(int width,int height) { //Resolution.CResolution ChangeRes=new Resolution.CResolution(tempHeight,tempWidth); Resolution.CResolution ChangeRes=new Resolution.CResolution(width,height); }
public void RetainResolution() { //Resolution.CResolution ChangeRes=new Resolution.CResolution(tempHeight,tempWidth); Resolution.CResolution ChangeRes=new Resolution.CResolution(tempWidth,tempHeight); }
public void ChangeResolution() { Resolution.CResolution ChangeRes=new Resolution.CResolution(FixWidth,FixHeight); }