How to show/hide an MS Office MDI application ?

G

Guest

Hello

I want to be able to show/hide an application that is running. When i am
getting the handles corresponding to an MS Office application (Excel for
example), it appears that i get a handle for the Excel MDI application which
got MDI children corresponding to the document(s) opened. Therefore, i am
able to hide the Excel window and the documents it contains. But there also
is a handle corresponding to the button which appears in the taskbar. Excel
doesnt seem to be a regular MDI application, as you can see an icon in the
taskbar for each opened documents, instead of seeing only one for the Excel
MDI application.

First i thought, this was working as the "Owner/Owned windows" model (Visual
Studio .net for example), which behavior is the following :
- when the owner is reduced, the owned windows are hidden.
- when the owner is restored, the owned windows are shown.
For this kind of applications i can call the GetWindow with OWNER
parameter, and find the owner this way.

But for the case of Excel application, the Excel MDI application does not
have any parent or owner. And the taskbar handle do not have any children. So
i dont know how to establish the relation between them.

Was hoping someone has maybe already had solved this problem. Help would be
more than appreciated :)

Thanks.

Flo
 
G

Gabriel Lozano-Morán

Excel
doesnt seem to be a regular MDI application, as you can see an icon in the
taskbar for each opened documents, instead of seeing only one for the Excel
MDI application.

In Excel navigate to Tools -> Options -> Tab View -> Section Show -> Uncheck
"Windows in Taskbar" or you should be able to do this programmaticaly. Hope
this solves a part of the problem.

Gabriel Lozano-Morán
 
G

Guest

Found the answer for this problem if anyone encounter the same questions
about windows behaviours :

In fact, Excel application got a top level window that is the MDI owner,
which got children windows that are the xls documents opened (whatever the
number). And the button in the taskbar for these xls documents are top level
windows as well. The relationship for these top level windows is that they
got the same thread process id (id of the thread that created the windows).


Thanks for your answer gabriel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top