Пример #1
0
        /*--- Method: private -----------------------------------------------------------------------------------------------------------------------------------------*/

        /// <summary> 標準型タイムラインビューを開きます。
        /// </summary>
        /// <param name="pTimelineC"> タイムラインコンポーネント </param>
        /// <param name="pOverlayViewC"> オーバーレイ表示コンポーネント </param>
        private void openStandardTimelineView(CommonDataModel pCommonDM, TimelineComponent pTimelineC, OverlayViewComponent pOverlayViewC)
        {
            OverlayWindow window = new OverlayWindow();

            window.Topmost = true;
            var vm = window.DataContext as OverlayWindowViewModel;

            if (vm != null)
            {
                vm.TimelineComponent    = pTimelineC;
                vm.OverlayViewComponent = pOverlayViewC;
            }

            if (pOverlayViewC.CommonDataModel.AppStatusData.AppMode != AppMode.Desing)
            {
                window.Show();
            }

            // ViewのIntPtrを採取
            IntPtr intPtr = new WindowInteropHelper(window).Handle;

            pOverlayViewC.OverlayDataModel.OverlayWindowData.WindowIntPtr = intPtr;
            if (!pCommonDM.AppCommonData.ViewIntPtrList.Contains(intPtr))
            {
                pCommonDM.AppCommonData.ViewIntPtrList.Add(intPtr);
            }

            if (pOverlayViewC.OverlayDataModel.OverlayWindowData.WindowLock)
            {
                WindowsServices.SetWindowExTransparent(pOverlayViewC.OverlayDataModel.OverlayWindowData.WindowIntPtr);
            }
        }
Пример #2
0
        private void ME_ToggledOn()
        {
            if (GlobalResources.UserInputMonitoringChecked)
            {
                User_Input_Monitoring.InitialiseUserInputMonitoring();
            }

            if (GlobalResources.ProcessMonitoring)
            {
                Process_Monitoring.InitialiseProcessMonitoring();
            }

            if (GlobalResources.FileSystemMonitoring)
            {
                File_System_Monitoring.InitialiseFileSystemMonitoring();
            }

            if (GlobalResources.ProcessPortMapper)
            {
                PPM.InitializePPM();
            }

            if (GlobalResources.WindowsServices)
            {
                WindowsServices.InitializePPM();
            }

            if (GlobalResources.ApplicationsMonitoring)
            {
                Applications_Monitoring.InitializeApplicationMonitoring();
            }

            GlobalResources.ITurnedOnMonitoringEngine();
            GlobalResources.IInitiatedSettingsUpdate();
        }
Пример #3
0
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);
            var hwnd = new System.Windows.Interop.WindowInteropHelper(this).Handle;

            WindowsServices.SetWindowExTransparent(hwnd);
        }
Пример #4
0
        /// <summary>
        /// </summary>
        public override void Execute()
        {
            // Call base execute to ensure that base functionality is called if there are any.
            base.Execute();

            if (!String.IsNullOrEmpty(this.Name))
            {
                IIServerManager.RecycleApplicationPool(this.Name);
            }

            if (this.AllPools == true)
            {
                IIServerManager.RecycleApplicationPools();
            }

            if (this.OwsTimer == true)
            {
                WindowsServices.Restart(WindowsServices.Current.SPTimerName);
            }

            if (this.AdmTimer == true)
            {
                WindowsServices.Restart(WindowsServices.Current.SPAdminName);
            }

            if (this.All == true || NothingSpecified())
            {
                IIServerManager.RecycleApplicationPools();
                WindowsServices.Restart(WindowsServices.Current.SPTimerName);
                WindowsServices.Restart(WindowsServices.Current.SPAdminName);
            }
        }
Пример #5
0
        public MainLauncherWindow()
        {
            InitializeComponent();

            fileService             = new WinFileService();
            dialogService           = new WinDialogService();
            freeLanDetectionService = new FreeLanDetectionService(fileService, dialogService);
            windowsServices         = new WindowsServices();
            networkAdapters         = new NetworkAdapters();
            freeLanService          = new FreeLanService(
                windowsServices,
                freeLanDetectionService,
                dialogService
                );



            if (!EnvHelper.IsAdministrator())
            {
                MessageBox.Show("To use this application you will need administrator privileges!");
                System.Environment.Exit(0);
            }

            UpdateWindow();
        }
Пример #6
0
        /// <summary>
        /// Initialize service classes for working with our windows service
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void MainForm_Load(object sender, EventArgs e)
        {
            servicesOperations = new Serviceinstaller(
                ConfigurationManager.AppSettings["ExecutableName"],
                ConfigurationManager.AppSettings["ServiceKnownName"],
                ConfigurationManager.AppSettings["ServiceProjectFolder"]);


            var serviceName = ConfigurationManager.AppSettings["ServiceKnownName"] ?? throw new ArgumentNullException("ServiceKnownName not set");

            this.Text = $"{serviceName}: utility";

            // create a manual uninstall batch file
            if (Environment.UserName != "Karens")
            {
                DirectoryExtensions.CreateManualUninstallBatchFile(
                    servicesOperations.ServiceFolder,
                    servicesOperations.ServiceExecutableName);
            }

            utilityOperations = new WindowsServices();

            if (servicesOperations.ProceedWithOperations == false)
            {
                // disable all buttons except for the close button as
                // we can not continue because either the install executable or
                // the service executable were not found.
                Controls.OfType <Button>()
                .Where(button => button.Name != "applicationCloseButton")
                .ToList()
                .ForEach(button => button.Enabled = false);
            }
        }
Пример #7
0
        /*--- Method: public ------------------------------------------------------------------------------------------------------------------------------------------*/

        /// <summary> ACT本体またはFF14のウィンドウがアクティブかを確認し、bool値を返します。
        /// <para> ※64Bitじゃないと落ちる可能性有、注意 </para>
        /// </summary>
        /// <returns></returns>
        public bool ActRelationWindowActiveCheck()
        {
            try
            {
                uint pid;
                var  hWndFg = WindowsServices.GetForegroundWindow();
                if (hWndFg == IntPtr.Zero)
                {
                    // アクティブウィンドウ無し
                    return(false);
                }

                WindowsServices.GetWindowThreadProcessId(hWndFg, out pid);
                var exePath = System.Diagnostics.Process.GetProcessById((int)pid).MainModule.FileName;

                if (Path.GetFileName(exePath.ToString()) == "ffxiv.exe" ||
                    Path.GetFileName(exePath.ToString()) == "ffxiv_dx11.exe" ||
                    exePath.ToString() == System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(false);
            }
        }
Пример #8
0
        protected override void OnClosed(EventArgs e)
        {
            //WindowsServices.Close(this); // windows is pretty good at doing this by itself
            WindowsServices.UnregisterAllKeys(this);
            Settings.X = (long)Left;
            Settings.Y = (long)Top;
            if (Settings.Vertical)
            {
                Settings.VerticalWidth    = Width;
                Settings.VerticalHeight   = Height;
                Settings.HorizontalWidth  = HorizontalWidth;
                Settings.HorizontalHeight = HorizontalHeight;
            }
            else
            {
                Settings.HorizontalHeight = Height;
                Settings.HorizontalWidth  = Width;
                Settings.VerticalWidth    = VerticalHeight;
                Settings.VerticalHeight   = VerticalHeight;
            }

            Settings.ClickThrough = ClickThrough;
            Settings.AlwaysOnTop  = AlwaysOnTop;

            Settings.LastBO = BuildOrders.Current?.Title;

            Settings.Vertical = Vertical;
            Settings.Compact  = Compact;
            base.OnClosed(e);
        }
Пример #9
0
        public WindowsServicesWindow()
        {
            InitializeComponent();
            windowsServices = new WindowsServices();

            UpdateWindow();
        }
Пример #10
0
 public FreeLanService(WindowsServices windowsServices,
                       FreeLanDetectionService freeLanDetectionService,
                       IDialogService dialogService)
 {
     this.freeLanDetectionService = freeLanDetectionService;
     this.dialogService           = dialogService;
     this.windowsServices         = windowsServices;
 }
Пример #11
0
        protected override void Execute()
        {
            this.DTEInstance.BuildWindow.Clear();
            this.DTEInstance.BuildWindow.Activate();

            WindowsServices.Restart(WindowsServices.Current.SPTimerName);

            this.DTEInstance.WriteBuildAndStatusBar("Done recycling Windows SharePoint Services Timer!");
        }
Пример #12
0
 /// <summary> コマンド実行<オーバーレイロック切替コマンド> </summary>
 /// <param name="para"> コマンドパラメーター </param>
 private void _OverlayViewLockExecute()
 {
     if (this.OverlayDataModel.OverlayWindowData.WindowLock)
     {
         WindowsServices.SetWindowExTransparent(this.OverlayDataModel.OverlayWindowData.WindowIntPtr);
     }
     else
     {
         WindowsServices.InitWindowExTransparent(this.OverlayDataModel.OverlayWindowData.WindowIntPtr);
     }
 }
Пример #13
0
 private bool RegisterGlobalHotkey(ButtonData button, WindowsServices.HotkeyActivated callback)
 {
     try
     {
         var key = GenerateHotkey(button);
         var res = WindowsServices.RegisterKey(key, callback, this) >= 0;
         return(res);
     } catch (NotSupportedException)
     {
         return(false);
     }
 }
Пример #14
0
 private void searchcheck_Tick(object sender, EventArgs e)
 {
     if (WindowsServices.QueryStatus("WSearch") == ServiceStatus.Running)
     {
         SetSearchProvider();
         CairoSearchMenu.Visibility = Visibility.Visible;
         (sender as DispatcherTimer).Stop();
     }
     else
     {
         CairoSearchMenu.Visibility = Visibility.Collapsed;
     }
 }
        /// <summary> コマンド実行<オーバーレイロック切替コマンド> </summary>
        /// <param name="para"> コマンドパラメーター </param>
        private void _OverlayViewLockExecute(OverlayViewComponent para)
        {
            if (para == null) return;

            if(para.OverlayDataModel.OverlayWindowData.WindowLock)
            {
                WindowsServices.SetWindowExTransparent(para.OverlayDataModel.OverlayWindowData.WindowIntPtr);
            }
            else
            {
                WindowsServices.InitWindowExTransparent(para.OverlayDataModel.OverlayWindowData.WindowIntPtr);
            }
        }
Пример #16
0
 /// <summary> コンポーネント終了の処理を実行します。
 /// </summary>
 public void ComponentShutdown()
 {
     foreach (var ip in base.CommonDataModel.AppCommonData.ViewIntPtrList)
     {
         try
         {
             WindowsServices.WindowCloseSendMessage(ip);
         }
         catch
         {
         }
     }
 }
        /// <summary> コマンド実行<オーバーレイ表示切替コマンド> </summary>
        /// <param name="para"> コマンドパラメーター </param>
        private void _OverlayViewChangedExecute(OverlayViewComponent para)
        {
            if (para == null) return;

            if (para.OverlayDataModel.OverlayWindowData.WindowVisibility)
            {
                this.OverlayManageModule.ShowOverlay(base.CommonDataModel, this.TimelineComponent, para);
            }
            else
            {
                WindowsServices.WindowCloseSendMessage(para.OverlayDataModel.OverlayWindowData.WindowIntPtr);
                para.OverlayDataModel.OverlayWindowData.WindowIntPtr = IntPtr.Zero;
            }

        }
Пример #18
0
 private void SetupSearch()
 {
     // Show the search button only if the service is running
     if (WindowsServices.QueryStatus("WSearch") == ServiceStatus.Running)
     {
         SetSearchProvider();
     }
     else
     {
         CairoSearchMenu.Visibility = Visibility.Collapsed;
         DispatcherTimer searchcheck = new DispatcherTimer(DispatcherPriority.Background, Dispatcher)
         {
             Interval = new TimeSpan(0, 0, 5)
         };
         searchcheck.Tick += searchcheck_Tick;
         searchcheck.Start();
     }
 }
Пример #19
0
        private void setupSearch()
        {
            CommandBindings.Add(new CommandBinding(CustomCommands.OpenSearchResult, ExecuteOpenSearchResult));

            // Show the search button only if the service is running
            if (WindowsServices.QueryStatus("WSearch") == ServiceStatus.Running)
            {
                setSearchProvider();
            }
            else
            {
                CairoSearchMenu.Visibility = Visibility.Collapsed;
                DispatcherTimer searchcheck = new DispatcherTimer(DispatcherPriority.Background, Dispatcher);
                searchcheck.Interval = new TimeSpan(0, 0, 5);
                searchcheck.Tick    += searchcheck_Tick;
                searchcheck.Start();
            }
        }
Пример #20
0
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);
            var hwnd = new WindowInteropHelper(this).Handle;

            WindowsServices.SetWindowExTransparent(hwnd);

            GlobalHotkeys = new GlobalHotkeys(hwnd);
            GlobalHotkeys.Register(GlobalHotkeys.MOD_NONE,
                                   GlobalHotkeys.VK_PAUSE,
                                   (hwnd, lParam) =>
            {
                Application.Current.Shutdown();
                return(true);
            });

            media.MediaDisplayed += Media_MediaDisplayed;
            media.OnMediaDisplayed(new Uri(".", UriKind.Relative));
        }
Пример #21
0
        public bool Register(uint mod, uint key, Func <IntPtr, IntPtr, bool> f)
        {
            int id = HOTKEY_ID_BEGIN + counter;

            if (WindowsServices.RegisterHotKey(hwnd, id, MOD_NONE, VK_PAUSE))
            {
                HotkeyToFunction.Add(id, (hwnd, lParam) =>
                {
                    System.Windows.Application.Current.Shutdown();
                    return(true);
                });
                counter++;
            }
            else
            {
                return(false);
            }
            return(true);
        }
Пример #22
0
        private void btnBoost_Click(object sender, EventArgs e)
        {
            bool isExcute_WinCleanup;

            WindowsCleanup.Excute_WindowsCleanup(cbxList_WC, out isExcute_WinCleanup);

            WindowsServices.ChangeStatusServices(List_SVC, toggleSwitch);

            bool isExcute_Tweaks;

            Tweaks.Excute_Tweaks(cbxList_Tweaks, out isExcute_Tweaks);

            if (SystemInfo.getOSName().Contains("Windows 7") == true && cbxDisableSmartScreen.Checked == true && (cbxDisableSystemRestore.Checked == false && cbxDisableCDBurningFeatures.Checked == false && cbxDisableWinSideBar.Checked == false && cbxSpeedUpMenuShow.Checked == false && cbxSpeedUpShutdown.Checked == false && cbxDisableAutorun.Checked == false))
            {
                isExcute_Tweaks = false;
            }
            if (isExcute_WinCleanup == true || isExcute_Tweaks == true)
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("Boost Completed.", "Windows Booster", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #23
0
        /// <summary> 既存のオーバーレイを削除します。
        /// </summary>
        /// <param name="pOverlayViewC"> 削除するオーバーレイデータ </param>
        /// <param name="pCommonDM"> 値参照用の共通データモデル </param>
        /// <param name="pOverlayManageDM"> 削除データのコレクションを持つオーバーレイ管理モデル </param>
        public void DeleteOverlay(OverlayViewComponent pOverlayViewC, CommonDataModel pCommonDM, OverlayManageDataModel pOverlayManageDM)
        {
            if (pCommonDM == null || pCommonDM.ApplicationData == null)
            {
                return;
            }

            string fileName = pCommonDM.ApplicationData.OverlayDataPartName + String.Format("{0:0000}", pOverlayViewC.OverlayDataModel.OverlayWindowData.ID) + ".xml";
            string path     = Path.Combine(pCommonDM.ApplicationData.RoamingDirectoryPath, "OverlayData", fileName);

            pOverlayManageDM.OverlayViewComponentCollection.Remove(pOverlayViewC);
            pCommonDM.ViewCollection.Remove(pOverlayViewC);

            WindowsServices.WindowCloseSendMessage(pOverlayViewC.OverlayDataModel.OverlayWindowData.WindowIntPtr);
            pOverlayViewC.OverlayDataModel.OverlayWindowData.WindowIntPtr = IntPtr.Zero;

            pOverlayViewC = null;

            if (File.Exists(path))
            {
                File.Delete(path);
            }
        }
Пример #24
0
    public Form1()
    {
        waterMarkLabel = new Label
        {
            Anchor    = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right),
            Font      = new Font("Microsoft Sans Serif", 80F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))),
            ForeColor = SystemColors.ControlDarkDark,
            Location  = new Point(126, 178),
            Name      = "WATERMARK",
            Size      = new Size(338, 120),
            TabIndex  = 0,
            Text      = "W A T E R M A R K",
            TextAlign = ContentAlignment.MiddleCenter
        };
        InitializeComponent();
        SuspendLayout();
        AutoScaleDimensions = new SizeF(6F, 13F);
        AutoScaleMode       = AutoScaleMode.Font;
        ClientSize          = new Size(579, 489);
        ControlBox          = false;
        FormBorderStyle     = FormBorderStyle.None;
        MaximizeBox         = false;
        MinimizeBox         = false;
        Opacity             = 0.1D;
        ShowIcon            = false;
        ShowInTaskbar       = false;
        TopMost             = true;
        var hwnd = Handle;

        WindowsServices.SetWindowExTransparent(hwnd);
        TopMost           = true;
        AllowTransparency = true;
        ResumeLayout(false);
        Controls.Add(waterMarkLabel);
        WindowState = FormWindowState.Maximized;
    }
Пример #25
0
        public void Initialize()
        {
            try
            {

#if EnableLock
                SenseLock.Instance.Open();
                if (SenseLock.Instance.VerifyUserPin("d6465065"))
                {
                    LockDaemon.Instance.OnUnplug =
                        () => MessageBox.Show("请使用加密狗!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    LockDaemon.Instance.Start();
                    XmlPassword.Instance.Password = SenseLock.Instance.GetKey();
                    if (SenseLock.Instance.GetTime() < DateTime.Now)
                    {
                        MessageBox.Show("加密狗已过期,请联系管理员!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
#else
                XmlPassword.Instance.Password = "******";
#endif
                InitExceptionLogger();
                InitiationConfig();
                if (!string.IsNullOrEmpty(MapConfig.Instance.TimeLock))
                {
                    var currentTime = DateTime.Now.ToShortDateString();
                    var lastTime = DateTime.Parse(MapConfig.Instance.TimeLock);
                    var ts = DateTime.Now.Subtract(lastTime);
                    if (ts.Days < 0)
                    {
                        MessageBox.Show("插件已过期", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        return;
                    }
                    var pastdueTime = DateTime.Parse("2015/6/30 00:00:00");
                    var pastdue = pastdueTime.Subtract(DateTime.Now);
                    if (pastdue.Days < 0)
                    {
                        MessageBox.Show("插件已过期", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        return;
                    }
                    MapConfig.Instance.TimeLock = currentTime;
                    PublicMethod.Instance.SaveLocalMapConfig();
                }
                ChangeAutoCADWindow();
                EnsureInitialize();
                CADTypes.CreateLineType();
                CADTypes.CreateStyle();
                InstallCADPlugin();

                //启动台帐服务
                WindowsServices.TomcatServiceStart();
#if EnableLock
                }
                else
                {
                    SenseLock.Instance.Close();
                }
#endif
            }
            catch (CADException ex)
            {
                LogManager.Instance.Error(ex);
            }
        }
Пример #26
0
 public void clickeable()
 {
     WindowsServices.makeNormal(hwnd);
 }
Пример #27
0
 /// <summary> コマンド実行<オーバーレイ終了コマンド> </summary>
 private void _OverlayClosedExecute()
 {
     WindowsServices.WindowCloseSendMessage(this.OverlayDataModel.OverlayWindowData.WindowIntPtr);
     this.OverlayDataModel.OverlayWindowData.WindowVisibility = false;
 }
Пример #28
0
        public void SetClickThrou()
        {
            var hwnd = new WindowInteropHelper(this).Handle;

            WindowsServices.SetWindowExTransparent(hwnd);
        }
Пример #29
0
        public void UnsetClickThrou()
        {
            var hwnd = new WindowInteropHelper(this).Handle;

            WindowsServices.SetWindowExVisible(hwnd);
        }
Пример #30
0
 public void SetUp()
 {
     WindowsServices.StartService(ServiceName, WaitTimeout);
 }