improve:PPT联动
This commit is contained in:
@@ -543,8 +543,36 @@ namespace Ink_Canvas.Helpers
|
||||
}
|
||||
else
|
||||
{
|
||||
_lastPolledSlideNumber = -1;
|
||||
SlidesCount = 0;
|
||||
if (_lastSlideShowState)
|
||||
{
|
||||
LogHelper.WriteLogToFile("轮询检测到放映已结束", LogHelper.LogType.Trace);
|
||||
|
||||
PPTROTConnectionHelper.SafeReleaseComObject(_pptSlideShowWindow);
|
||||
_pptSlideShowWindow = null;
|
||||
_lastPolledSlideNumber = -1;
|
||||
_polling = 1;
|
||||
SlidesCount = 0;
|
||||
|
||||
_lastSlideShowState = false;
|
||||
SlideShowStateChanged?.Invoke(false);
|
||||
|
||||
if (_pptActivePresentation != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
OnSlideShowEnd(_pptActivePresentation);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"触发SlideShowEnd事件失败: {ex.Message}", LogHelper.LogType.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_lastPolledSlideNumber = -1;
|
||||
SlidesCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -878,7 +906,35 @@ namespace Ink_Canvas.Helpers
|
||||
}
|
||||
else
|
||||
{
|
||||
SlidesCount = 0;
|
||||
if (_lastSlideShowState)
|
||||
{
|
||||
LogHelper.WriteLogToFile("轮询检测到放映已结束", LogHelper.LogType.Trace);
|
||||
|
||||
PPTROTConnectionHelper.SafeReleaseComObject(_pptSlideShowWindow);
|
||||
_pptSlideShowWindow = null;
|
||||
_lastPolledSlideNumber = -1;
|
||||
_polling = 1;
|
||||
SlidesCount = 0;
|
||||
|
||||
_lastSlideShowState = false;
|
||||
SlideShowStateChanged?.Invoke(false);
|
||||
|
||||
if (_pptActivePresentation != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
OnSlideShowEnd(_pptActivePresentation);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"触发SlideShowEnd事件失败: {ex.Message}", LogHelper.LogType.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SlidesCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -394,21 +394,21 @@ namespace Ink_Canvas.Helpers
|
||||
|
||||
if (fgPid == sswPid) return true;
|
||||
|
||||
try
|
||||
{
|
||||
using (Process fgProc = Process.GetProcessById((int)fgPid))
|
||||
using (Process appProc = Process.GetProcessById((int)sswPid))
|
||||
try
|
||||
{
|
||||
string fgName = fgProc.ProcessName.ToLower();
|
||||
string appName = appProc.ProcessName.ToLower();
|
||||
|
||||
if (fgName.StartsWith("wps") && appName.StartsWith("wpp"))
|
||||
using (Process fgProc = Process.GetProcessById((int)fgPid))
|
||||
using (Process appProc = Process.GetProcessById((int)sswPid))
|
||||
{
|
||||
return true;
|
||||
string fgName = fgProc.ProcessName.ToLower();
|
||||
string appName = appProc.ProcessName.ToLower();
|
||||
|
||||
if (fgName.StartsWith("wps") && appName.StartsWith("wpp"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch { }
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user