我需要显示消息页面或按钮的代码以通知用户“保存图纸Autocad将自动关闭”
我发现在按下“安装”按钮后强制关闭AutoCAD的代码。
=findvalueandrange(searchstring,selectyourrange)
Public Function findvalueandrange(findingtext As String, r As Range) As String
Dim cell As Range
For Each cell In r.Cells
If LCase(cell.Value) = LCase(findingtext) Then
If findvalueandrange = "" Then
findvalueandrange = cell.Address & ":" & cell.Value
Else
findvalueandrange = findvalueandrange & "|" & cell.Address & ":" & cell.Value
End If
End If
Next cell
End Function
答案 0 :(得分:0)
代码应该是:
[Code]
function InitializeSetup(): Boolean;
var
ErrorCode: Integer;
begin
if MsgBox('Save your Drawings and close Autocad', mbConfirmation, MB_OK) = IDOK then
begin
ShellExec('open', 'taskkill.exe', '/f /im acad.exe','', SW_HIDE, ewNoWait, ErrorCode);
ShellExec('open', 'tskill.exe', ' ACAD', '', SW_HIDE, ewNoWait, ErrorCode);
Result := True;
end
else
begin
Result := False;
end;
end;