PDM add-in message box hiding behind transition progress window

I am writing a PDM add-in to catch when files finish going through a certain transition. Upon completion of the actions I am bring up a message box to notify the user of completion.

The issue I am having is the transition progress window is still showing when the msgbox opens causing the msgbox to be behind the transition progress window, barely visible.

The API help file Keeping Add-in Windows in the Foreground - 2021 - SOLIDWORKS API Help is completely blank. Does anyone have any tricks for getting the msgbox to show in the foreground so it isn’t hidden.

1 Like

The handle you get from the poCmd (mlParentWnd) is probably of the File Explorer window so you are out of luck there. The transition window however is a child of the File Explorer.

I have seen people do these:

  • You can find the transition dialog window handle before you display your form. You can then paint your form atop it. You need to use Win32 API to get the window handle.

  • Or you can set your form TopMost to true which would paint your form ontop of everything. This might not be ideal if your form doesn’t have a minimize button.

  • I have seen other add-ins paint their forms on the upper left side of the File Explorer window which is probably your best option since that gives the user visibility of your form and the transition window at the same time.

I’d probably go with the third one.

Hope this helps @MMartens !

1 Like

@MMartens : Thanks for posting for the first time btw! :smiley: :fireworks:

Thanks for the help. I used your 2nd suggestion and got myself to a workable solution.
Instead of using Forms.Mesage box as I had been, I created a simple user form with just a label for my message and an OK button. Now when I use the Show method, it shows up on top of all the other windows as desired.

1 Like