示例#1
0
文件: Form1.cs 项目: coderli7/WinForm
 /// <summary>
 /// 设置微信窗口前置-避免因为遮挡等原因造成解析不成功
 /// </summary>
 private void SetWeChatFormBefore()
 {
     if (weChatForm != null && weChatForm.ToInt32() > 0)
     {
         //最小化某些窗口
         WindowFormAPI.MinOrMaxWindowFormByTitle(new string[] { "发起会话", "TeamViewer Panel" }, 2);
         LogInfo("最大化微信窗口");
         //暂时不按照正常处理,减少因为刷屏导致卡屏,造成截屏失败
         //WindowFormAPI.ShowWindow(weChatForm, 1);
         WindowFormAPI.ShowWindow(weChatForm, 3);
         LogInfo("前置微信窗口");
         WindowFormAPI.SetForegroundWindow(weChatForm);
     }
 }
示例#2
0
文件: Form1.cs 项目: coderli7/WinForm
        void StatusTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            //socket连接一直维持
            ConnectSocketServerNew();
            if (DateTime.Now.Hour == 6)
            {
                if (DateTime.Now.Minute >= 45 && DateTime.Now.Minute <= 50)
                {
                    LogInfo(string.Format("重置了GetWeChatQrCodeCount次数"));
                    GetWeChatQrCodeCount = 0;
                    richTextBox1Sb       = new StringBuilder();
                }
            }

            //最小化某些窗口
            WindowFormAPI.MinOrMaxWindowFormByTitle(Config.MinFormTitles, 2);
        }