在 MessageBox 中单击 "OK" 时如何从消息框打开浏览器后关闭父对话框

How to close the parent dilaog after opened the browser from the message box when clicked on "OK" in the MessageBox

我在安装安装程序之前检查所需的软件,如果该软件不存在,我将显示带有“确定”按钮的消息框。当用户点击 在“确定”上,它正在导航到给定的 URL 以安装缺少的软件。但这里的问题是,当从消息框导航到支持页面时,父对话框没有关闭。

当用户单击“确定”按钮时,我尝试了不同的方法来关闭父对话框。有没有关闭dilaog的方法请指教

 Function IsDotNetInstalled
    ClearErrors
    ReadRegStr [=11=] HKLM "Software\Microsoft\.NETFramework\policy\v3.0" "20319"
    IfErrors Error
    Goto End
    
    Error:
    
    MessageBox MB_OK|MB_ICONSTOP "Setup could not detect Microsoft .NET Framework v4.0 on this computer. $\r$\n$\r$\n Please install Microsoft .NET Framework v4.0 and run setup again. $\r$\n$\r$\n Click on OK to navigate to the Microsoft Support page" IDOK
    
    ExecShell open "https://www.microsoft.com/en-in/download/details.aspx?id=17718"
    
   SendMessage $HwndParent ${WM_QUIT} 0 0
   Abort
   Quit
    
    End:
    SendMessage $HwndParent ${WM_QUIT} 0 0
    Abort
    Quit
    FunctionEnd

我正在从以下部分调用上述函数:

Section "RegistryTest (required)"
SectionIn RO

Call IsDotNetInstalled
ExecShell "" "$INSTDIR\Test.exe"

SectionEnd

Abort取消你所在的函数,在Abort之前尝试SendMessage。然而,发送 WM_QUIT 是邪恶的,应该是你最后的选择。应用程序通常不设计用于处理意外的 WM_QUIT 消息。

你的问题没有上下文,所以我不知道这个函数是在哪里调用的。 Quit 也可能有效,具体取决于调用它的回调,并且在有效时始终是更好的选择。