A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Collapsing Word Menu



 
 
Thread Tools Display Modes
  #1  
Old October 19th, 2006, 10:43 AM posted to microsoft.public.word.tables
Enn
external usenet poster
 
Posts: 1
Default Collapsing Word Menu

I have got an issue with programatically closing / collapsing the word menu.
Here is what I am doing...

I have a Windows forms based application developed in C#. I have an user
control within the form. I create the Word application object and a word
document. I open a .doc file and get the window handle to the word Document
using PInvoke (FindWindow). I set the user control as the parent window to
the handle I got above. So I am able to see the Word document in the use
control.

Now when I click on any of the menu items (say for example, on File or Edit
or View...), keep the menu open / expanded and click on any other application
running from the task bar and click on my application again - my application
is not getting the focus.

I suspected that the menu opens a new window which has obtained the focus
and when I switch back the menu window has the focus and not my application.

I have tried the following:

1. Tried to subclass (using NativeWindow) the menu (MsoCommandBar and
"MenuBar") using FindWindow. This way I tried to close the menu window by
posting a message. I did not get any messages on menu click. After Googling I
found that it is not possible to subclass an unmanaged window in managed
window.

Can you please help me with the solution?

TIA

Enn
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.