How to dismiss Desktop Connector dialog

How to dismiss Desktop Connector dialog

ebarMLN7G
Enthusiast Enthusiast
690 Views
5 Replies
Message 1 of 6

How to dismiss Desktop Connector dialog

ebarMLN7G
Enthusiast
Enthusiast

We have a plugin that opens a model on Revit startup. We also have added appropriate event listeners to automatically dismiss all the pop up messages and warnings ( application.DialogBoxShowing and
application.ControlledApplication.FailureProcessing) It works as expected for some of our models, but for some other models we run into this dialog box:

 

Screen Shot 2022-01-20 at 1.16.04 PM.png

It seems like the dialog in not being detected through our event listeners (Not sure if the dialog is launched by Revit). We can manually dismiss it and the plugin works as expected, but it defeats the whole purpose of automatically dismissing the dialogs. I have two questions:

 

1- Is there a way to dismiss the dialog programmatically? Maybe there is an another even we can subscribe to? Maybe there is a way through Windows APIs to get some control over that dialog box?

 

2- If automatically dismissing it is not an option, is there a way we can setup our linked documents so it wouldn't have any dependency over Desktop Connector? (The dialog doesn't show up for all the models)

 

Unfortunately we cannot guarantee that all of our machines have the latest version of Desktop Connector installed, so that's not an option. 

0 Likes
691 Views
5 Replies
Replies (5)
Message 2 of 6

architect.bim
Collaborator
Collaborator

Hi!

Have a look at this article. May be you will find necessary approach there.


Maxim Stepannikov | Architect, BIM Manager, Instructor
0 Likes
Message 3 of 6

ebarMLN7G
Enthusiast
Enthusiast

Hi Maxim, We already have code to handle those dialog boxes, very similar to the article that you shared.. Unfortunately for this particular dialog application.DialogBoxShowing doesn't receive a call. We do however receive a couple warnings through application.ControlledApplication.FailuresProcessing, but the failure messages for those events are empty. 

0 Likes
Message 4 of 6

RPTHOMAS108
Mentor
Mentor

If this dialogue appears on start-up does it happen before OnStartUp? If so then I don't see a way via IExternalApplication.

 

Only way then you could dismiss it is if you have something looking for the appearance of it (non Revit process). You could detect the appearance of it via something such as EnumWindows and then send it messages to ok it.

 

However where does 'How do I update Desktop Connector?' send you?

 

In the below link there is some information regarding supressing update notifications in the registry:

Administrator Guide | Desktop Connector 2023 | Autodesk Knowledge Network

 

I'm not familiar with it and don't know what version you may be using i.e. if above is applicable.

 

0 Likes
Message 5 of 6

ebarMLN7G
Enthusiast
Enthusiast

It does happen after OnStartup. But I don't get any callback on application.DialogBoxShowing when it appears. I can update Desktop Connector on my personal machine, but cannot guarantee that for all the machines that would run the plugin. 

 

I guess EnumWindows is something I can try.

0 Likes
Message 6 of 6

jeremy_tammik
Alumni
Alumni

Please refer to The Building Coder topic group on detecting and handling dialogues and failures:

 

 

The first few articles there were written before the advent of the Revit API functionality, e.g., dialogue showing event and failure handling API.  JtClicker uses a Windows hook implemented using pure Windows API and .NET libraries to simulate the user clicking a specific button in a specific form.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes