none
Prevent a user from clicking controls/sending keyboard inputs to a process UI RRS feed

  • Question

  • Hi,

    I have a scenario where I spawn a different process to install update to my Outlook Add-In. Here the updater process has its own UI (basically dialogs). When I start the updater process, I will wait for it to complete in my main process (Outlook process). Here, I don't want to let the user to do something with the Outlook UI while the updater is running. Is there a way to do this? I heard of Windows Hooks but not sure whether its the only way. Please provide sample examples.

    Thanks in advance.


    Thanks Prasad

    Monday, April 13, 2015 6:38 PM

Answers

  • Hi Prasad,

    I think the best way is to close the Outlook application, because as far as I know, if you want to re-install the add-in, you may need to restart Outlook application. If you have to keep the Outlook application opened, you can also consider hiding the Outlook window, or creating a layer right on the Outlook application window, with Windows Forms form or WPF form.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Prasad U S Tuesday, April 14, 2015 4:40 PM
    Tuesday, April 14, 2015 7:04 AM
    Moderator
  • Prasad,

    Why do you need to invent a wheel for updating the add-in?

    You can use ClickOnce for updating the add-in at runtime. See Deploying an Office Solution by Using ClickOnce for more information. 

    Anyway, to prevent any user input you can display a modal form specifying the parent Outlook window handle. Only your form will be able to get the input until it is closed.

    • Marked as answer by Prasad U S Tuesday, April 14, 2015 4:40 PM
    Tuesday, April 14, 2015 7:24 AM

All replies

  • Hi Prasad,

    I think the best way is to close the Outlook application, because as far as I know, if you want to re-install the add-in, you may need to restart Outlook application. If you have to keep the Outlook application opened, you can also consider hiding the Outlook window, or creating a layer right on the Outlook application window, with Windows Forms form or WPF form.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Prasad U S Tuesday, April 14, 2015 4:40 PM
    Tuesday, April 14, 2015 7:04 AM
    Moderator
  • Prasad,

    Why do you need to invent a wheel for updating the add-in?

    You can use ClickOnce for updating the add-in at runtime. See Deploying an Office Solution by Using ClickOnce for more information. 

    Anyway, to prevent any user input you can display a modal form specifying the parent Outlook window handle. Only your form will be able to get the input until it is closed.

    • Marked as answer by Prasad U S Tuesday, April 14, 2015 4:40 PM
    Tuesday, April 14, 2015 7:24 AM
  • Hi Caillen and Eugene,

    Thanks for your replies.

    @Eugene:

    I did the same, I created a hidden modal form (a layer) and I forked the updater thread within the form load event handler. Later I used Thread.Join() and after that I used BeginInvoke() to close the form. Its working well now.

    Thanks again.


    Thanks Prasad

    Tuesday, April 14, 2015 4:44 PM