Example #1
0
 /// <summary>
 /// 最大化最小化,指定标题窗口
 /// </summary>
 /// <param name="titleArr">标题组</param>
 /// <param name="handleType">操作类型 1,正常  2,最小化  3,最大化</param>
 public static void MinOrMaxWindowFormByTitle(string[] titleArr, int handleType)
 {
     foreach (var item in titleArr)
     {
         IntPtr curForm = FindWindow(null, item);
         if (curForm != null && curForm.ToInt32() > 0)
         {
             WindowFormAPI.ShowWindow(curForm, handleType);
         }
     }
 }
Example #2
0
 /// <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);
     }
 }