improve:PPT联动
This commit is contained in:
@@ -543,8 +543,36 @@ namespace Ink_Canvas.Helpers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_lastPolledSlideNumber = -1;
|
if (_lastSlideShowState)
|
||||||
SlidesCount = 0;
|
{
|
||||||
|
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
|
else
|
||||||
@@ -878,7 +906,35 @@ namespace Ink_Canvas.Helpers
|
|||||||
}
|
}
|
||||||
else
|
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)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -394,21 +394,21 @@ namespace Ink_Canvas.Helpers
|
|||||||
|
|
||||||
if (fgPid == sswPid) return true;
|
if (fgPid == sswPid) return true;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
|
||||||
using (Process fgProc = Process.GetProcessById((int)fgPid))
|
|
||||||
using (Process appProc = Process.GetProcessById((int)sswPid))
|
|
||||||
{
|
{
|
||||||
string fgName = fgProc.ProcessName.ToLower();
|
using (Process fgProc = Process.GetProcessById((int)fgPid))
|
||||||
string appName = appProc.ProcessName.ToLower();
|
using (Process appProc = Process.GetProcessById((int)sswPid))
|
||||||
|
|
||||||
if (fgName.StartsWith("wps") && appName.StartsWith("wpp"))
|
|
||||||
{
|
{
|
||||||
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user