Skip to content

Commit

Permalink
计时器间隔 1 秒方式来获取微信或者qq打开后的选中文件
Browse files Browse the repository at this point in the history
  • Loading branch information
indiff committed Feb 26, 2024
1 parent 1068670 commit 2fc0d6b
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions QTTabBar/QTTabBarClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2462,7 +2462,13 @@ private void DoFirstNavigation(bool before, string path) {
if (Config.Window.CaptureNewWindows &&
ModifierKeys != Keys.Control &&
InstanceManager.GetTotalInstanceCount() > 0) {
QTUtility2.log("DoFirstNavigation GetCommandLine");
// 增加父进程的判断, 这里获得的父进程是 winlogon svchost 这里获取父进程获取不到微信或者qq
// string parentProcessName = QTUtility.GetParentProcessName();
// string allParentProcessNames = QTUtility.GetAllParentProcessNames();
// string parentProcessName2 = ProcessUtil.GetParentProcess().ProcessName;
// string allParentProcessNames2 = ProcessUtil.GetAllParentProcessNames();
// QTUtility2.log("DoFirstNavigation GetCommandLine parent process name: " + parentProcessName);
// QTUtility2.log("DoFirstNavigation GetCommandLine parent process name2: " + allParentProcessNames2);
string cmd = GetCommandLine();
if (!String.IsNullOrEmpty(cmd))
{
Expand Down Expand Up @@ -2506,7 +2512,10 @@ private void DoFirstNavigation(bool before, string path) {
{
tabbar.OpenNewTab(path);
tabbar.RestoreWindow();
tabbar.Wait4Select();
if (Config.Window.CaptureWeChatSelection)
{
tabbar.Wait4Select();
}
TimeSpan abs = new TimeSpan(DateTime.Now.Ticks).Subtract(start).Duration();
QTUtility2.log(string.Format("factory cmd BeginInvokeMain cost {0} ", abs.TotalMilliseconds));
});
Expand All @@ -2520,7 +2529,7 @@ private void DoFirstNavigation(bool before, string path) {
tabbar.OpenNewTab(path);
QTUtility2.log("other cmd BeginInvokeMain RestoreWindow");
tabbar.RestoreWindow();
// tabbar.Wait4Select();
// tabbar.Wait4Select(); // intellij idea / vs code 导致崩溃?
});
}
}
Expand All @@ -2533,7 +2542,7 @@ private void DoFirstNavigation(bool before, string path) {
}
else
{
QTUtility2.log("Close Explorer Explorer.Quit1");

// QTUtility2.Wait4SelectFiles(Explorer);
// Wait4SelectedQuit();
// Explorer.Quit();
Expand All @@ -2543,9 +2552,10 @@ private void DoFirstNavigation(bool before, string path) {

if (mCmdType == 3 || !Config.Window.CaptureWeChatSelection)
{
QTUtility2.log("Close Explorer Explorer.Quit");
Explorer.Quit();
// WindowUtils.HideExplorer(ExplorerHandle);
WindowUtils.CloseExplorer(ExplorerHandle, 0);
// WindowUtils.CloseExplorer(ExplorerHandle, 0);
}
}
QTUtility2.log("DoFirstNavigation return");
Expand Down

0 comments on commit 2fc0d6b

Please sign in to comment.