2010-03-01 139 views
3

我想为我的安装程序创建一个自定义操作,检查Outlook是否正在运行,如果是,它会提示用户在继续之前关闭Outlook。MSI MessageBox自定义操作

一切都很好,只是当MessageBox出现通知用户他们必须关闭Outlook时,它会出现在当前MSI安装窗口的后面。我想让它出现在前面,但我无法弄清楚如何做到这一点。

我已经做了一些研究和MSIProcessMessage函数看起来像它会工作,但它是一个API函数,我不知道如何从我的代码调用它。

这里是我的代码片段:

 Dim bCont As Boolean = True 

     While bCont 
      If Process.GetProcessesByName("OUTLOOK").Length > 0 Then 
        MsgBox("Please close Microsoft Outlook before you install the MissingLink Project Management add-in.", MsgBoxStyle.Information, "MissingLink Project Center") 
      Else 
       bCont = False 
      End If 
     End While 

感谢,

凯文

回答