激活微信修改

This commit is contained in:
老道 2022-11-10 20:11:42 +08:00
parent 08a8297e0c
commit aa7b865624
2 changed files with 11 additions and 5 deletions

View File

@ -42,7 +42,7 @@ namespace PCRobot
try
{
WeChatActivateHelper.Init(TimeSpan.FromMinutes(20));
WeChatActivateHelper.Init(TimeSpan.FromMinutes(40));
}
catch (Exception exception)
{ }

View File

@ -115,7 +115,7 @@ namespace WechatHelper
if (isIconic)
{
ShowWindow(handle, 1);
Thread.Sleep(new Random(Guid.NewGuid().GetHashCode()).Next(8000, 10000));
Thread.Sleep(1000);
}
var thisHandel = Process.GetCurrentProcess().MainWindowHandle;
@ -153,10 +153,16 @@ namespace WechatHelper
}, null);
//如果微信最小化了,重新让他最小化
if (!isIconic) continue;
if (isIconic)
{
Thread.Sleep(1000);
ShowWindow(handle, 2);
}
//休眠
Thread.Sleep(new Random(Guid.NewGuid().GetHashCode()).Next(40000, 60000));
ShowWindow(handle, 2);
} while (true);
}
catch (Exception e)
@ -178,7 +184,7 @@ namespace WechatHelper
{
try
{
Thread.Sleep(1000);
Thread.Sleep(5000);
var rstHandlePtr = FindWindowExA(IntPtr.Zero, handle, className, windowName);
if (handle == IntPtr.Zero) break;
if (handleList.Contains(handle)) break;