0) { var paren。Excel催化剂开源第47波-Excel与PowerBIDeskTop互通互联之第一篇( 四 )。" />

Excel催化剂开源第47波-Excel与PowerBIDeskTop互通互联之第一篇( 四 )

{

// get the process pid

System.UInt32 pid = (System.UInt32)process["ProcessId"];

var parentPid = int.Parse(process["ParentProcessId"].ToString());

var parentTitle = "";

if (parentPid > 0)

{

var parentProcess = Process.GetProcessById(parentPid);

//if (parentProcess.ProcessName == "devenv") _icon = EmbeddedSSASIcon.Devenv;

parentTitle = parentProcess.MainWindowTitle;

if (parentTitle.Length == 0)

{

// for minimized windows we need to use some Win32 api calls to get the title

parentTitle = GetWindowTitle(parentPid);

推荐阅读