private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) { AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainOnAssemblyResolve; ArgCheck(); if (Process.GetProcessesByName("BDOA").Length > 1) { Process.GetCurrentProcess().Kill(); } _lic = new License("http://angelhci.bget.ru/LBDOA.php"); _bdoWindow = new BdoWindow(); _sc = new DxScreenCapture(); _dControl = new DControl(_speed); Imports.SetWindowLong(Process.GetCurrentProcess().MainWindowHandle, -20, Imports.GetWindowLong(Process.GetCurrentProcess().MainWindowHandle, -20) | 0x00000020); Start(); CheckLic(); new Thread(IntScan).Start(); Imgmax.Source = ImgHelpers.BitmapToImageSource(Properties.Resources._6); Imgsp.Source = ImgHelpers.BitmapToImageSource(Properties.Resources._8); IResume.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.resume); IDResume.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.delres); IStop.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.delallg); IAddUn.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.addun); IStartBack.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.startback); IDela.Source = ImgHelpers.BitmapToImageSource(Properties.Resources.dela); RenderOptions.SetBitmapScalingMode(Imgmax, BitmapScalingMode.HighQuality); RenderOptions.SetBitmapScalingMode(Imgsp, BitmapScalingMode.HighQuality); RenderOptions.SetBitmapScalingMode(IResume, BitmapScalingMode.HighQuality); RenderOptions.SetBitmapScalingMode(IDResume, BitmapScalingMode.HighQuality); RenderOptions.SetBitmapScalingMode(IStop, BitmapScalingMode.HighQuality); RenderOptions.SetBitmapScalingMode(IStartBack, BitmapScalingMode.HighQuality); RenderOptions.SetBitmapScalingMode(IDela, BitmapScalingMode.HighQuality); RenderOptions.SetBitmapScalingMode(IAddUn, BitmapScalingMode.HighQuality); _state = State.Off; Dispatcher.Invoke(() => { LABS.Content = "[Выкл]"; LABS.Foreground = new SolidColorBrush(Color.FromArgb(0xcc, 0xcc, 0x22, 0x22)); }); }
internal WindowState WindState(DxScreenCapture sc) { var b = new Sbmp(sc); if (_mfiltr.Compare(b, Filtr)) { if (_mrefr.Compare(b, Refr)) { Point pt; if (_mcap.Compare(b, PCap, out pt)) { Cap = new Rectangle(pt.X, pt.Y, 41, 6); LCaptcha = new Rectangle(Cap.X, Cap.Y - 49, 85, 33); RCaptcha = new Rectangle(Cap.X + 85, Cap.Y - 49, 85, 33); Min = new Rectangle(Cap.X + 245, Cap.Y - 119, 0, 0); CountF = new Rectangle(Cap.X + 166, Cap.Y - 105, 0, 0); CaptchaF = new Rectangle(Cap.X + 205, Cap.Y - 33, 0, 0); count = _mmin.Compare(b, Min); Ws = WindowState.Buying; } else { Ws = WindowState.Lots; } } else { Ws = WindowState.Main; } } else { Ws = WindowState.None; } return(Ws); }
internal Sbmp(DxScreenCapture sc) { _buf = sc.GetImg(); Width = Screen.PrimaryScreen.Bounds.Width; Height = Screen.PrimaryScreen.Bounds.Height; }