mfc >> Getting RichEdit's TOM/ITextDocument by its Window Handle?

by tmchyde » Wed, 21 Apr 2004 02:16:53 GMT

I cannot get the sample code from microsoft's example here of looking
up in the running object table by window handle for a RichEdit's

(scroll midway down to subtitle: Interface from Running Object Table)

I suspect the example code is in error as CreateFileMoniker makes no
mention of working with a windows handle number passed as a hex string
as the example shows...

Can anyone confirm it works or doesnt work or tell me how to
accomplish this another way?


Similar Threads

1. TOM / ITextDocument from out-of-process RichEdit?

2. Getting window position from IntPtr window handle


I am looking for a way in C# to use a IntPtr handle to a (possibly
unmanaged) windows form to get the current position of the window on
the desktop. I have tried using Form.FromHandle( handle ) but this
does not work for non .NET windows.

I am expecting to need to use SendMessage somewhere along the line,
but cannot find the correct message to get the window position. Also,
is there a way to perform simple operations on a window such as

Any help would be very much appreciated!
Many Thanks


3. Message Hook, getting target window handle - CSharp/C#

4. Getting the application name from a window handle

Well, What is application name? There is no way to define it given a window.
A window can be launched by a process by instatiating another process.  Best
you can try is to use GetModuleFileName to see what executable that window
belongs to.

"JasonC" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
> Hi,
> I have written an application that incorporates the functionality of the
C++ debug tool Spy++. I am getting a handle to a window of some other
application. How can I determine the application name from this handle?
> Thanks in advance for any advice
> Jason

5. getting another window's handle from a mouse click - CSharp/C#

6. getting the window handle at start up

I tried to get the window handle for DirectShow and Direct3D at start
up of the application. I got a runtime error whichever way I tried.

I tried from the main frame's constructor. I tried from the view's
constructor. And I tried from the application's InitInstance function.
None worked.

My guesses are either I'm not doing it with a thread safe approach, or
the window handle is not yet created when I try to use it.

So where and how can I safely grab the window handle for use?

7. Getting a handle to the contents of a window's contents

8. Getting handle to an MDI Window

I hope this is the correct group

I have an MDI app and I need to interact with a Componnet on one of the 
child windows - how do I get a handle to the active window - and for that 
matter for any of the windows that are on screen?