[WD18] - Re-activate my app window

Startbeitrag von JP am 25.09.2013 14:07

Hi All

I am trying to automate MS PowerPoint using the automation object. This works fine however when I create the instance of PowerPoint it becomes the active window, appearing in front of my application window. How do I force my application as the foremost window?

Antworten:

Hi JP

your application IS at the forefront (you are commanding powerpoint, it is therefeore 'part' of your application)... Generally, what is done is to tell powerpoint to become invisible, with one of it's automation syntax

Best regards

von Fabrice Harari - am 25.09.2013 14:36
Thanks Fabrice

PowerPoint cannot be made invisible and it is defintely the foremost /active window as far as Windows is concerned. Trying to make PowerPoint invisible causes an automation error. It is something unique to PowerPoint because Excel and Word can be made invisible.

However, I have made a work-around. In pseudo code you do this:


Create PowerPoint automation object // PowerPoint becomes visible immediately
Issue WinStatus( Your_Main_Window_name , AboveAll ) // This force your app window to forefront
Do whatever with PowerPoint automation object here - your app is foremost and can display status output
Issue WinStatus( Your_Main_Window_name, Normal ) // This stops your app from being forced on top of other apps


von JP - am 25.09.2013 15:02
Hi.

I had a similar problem (word instead of power point) and I solved it with:
WinStatus(MyWindow,AboveAll)
Maybe that come handly to you.

Edit: Well, I came too late.

Regards,
José Antonio.

von Jose Antonio Garrido - am 25.09.2013 15:07
Thanks José :)

von JP - am 25.09.2013 15:11
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.