Discussion:
Extended Rich Text Box Control
(too old to reply)
Jeff Gaines
2007-10-29 18:29:39 UTC
Permalink
I have down-loaded some source from the Code Project which contains a file
called ExtendedRichTextBox.dll which is supposed to be issued by MSFT and
to be an extended version of the RichText Box.

I am suspicious of the file - the company shown in its properties is BXSW
and there is no mention of MSFT.

Has anybody come across this control?
--
Jeff Gaines
Herfried K. Wagner [MVP]
2007-10-29 22:37:35 UTC
Permalink
Post by Jeff Gaines
I have down-loaded some source from the Code Project which contains a file
called ExtendedRichTextBox.dll which is supposed to be issued by MSFT and
to be an extended version of the RichText Box.
I am suspicious of the file - the company shown in its properties is BXSW
and there is no mention of MSFT.
I assume you are referring to this article:

Word Processor Based Upon an Extended RichTextBox Control - The Code
Project - C# Programming
<URL:http://www.codeproject.com/csharp/eRichTextBox.asp>

Maybe the control is based on this code (the articles Article ID is the same
as those mentioned in the CodeProject article):

How to print the content of a RichTextBox control by using Visual Basic .NET
or Visual Basic 2005
<URL:http://support.microsoft.com/?scid=kb;EN-US;811401>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jeff Gaines
2007-10-29 23:32:54 UTC
Permalink
Post by Herfried K. Wagner [MVP]
Word Processor Based Upon an Extended RichTextBox Control - The Code
Project - C# Programming
<url: http://www.codeproject.com/csharp/eRichTextBox.asp>
Yes, that's the one.
Post by Herfried K. Wagner [MVP]
Maybe the control is based on this code (the articles Article ID is the
How to print the content of a RichTextBox control by using Visual Basic
.NET or Visual Basic 2005
<url: http://support.microsoft.com/?scid=kb;EN-US;811401>
Could be, thanks for the link, I've down-loaded the original code from
MSFT. I've had no malware in 20 years of computing and I don't want to
start now!

What I really want to do is put a table in to an RTF document but Google
only produces the question, never the answer :-)
--
Jeff Gaines
Linda Liu[MSFT]
2007-10-30 08:17:16 UTC
Permalink
Hi Jeff,
Post by Jeff Gaines
What I really want to do is put a table in to an RTF document
Do you mean that you'd like to draw a table into an RTF document within
your own application?

The .NET RichTextBox control doesn't provide such an advanced function so
far. IMO, a possible workaround to this question is to embed Microsoft
Office Word into your own WinForm application.

I found a sample of how to embed a Word document in a WinForm application
on the CodeProject web site. You may take it for reference:
http://www.codeproject.com/cs/miscctrl/winwordcontrol.asp

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Jeff Gaines
2007-10-30 14:27:59 UTC
Permalink
Post by Linda Liu[MSFT]
Hi Jeff,
Post by Jeff Gaines
What I really want to do is put a table in to an RTF document
Do you mean that you'd like to draw a table into an RTF document within
your own application?
Yes, I thought it would be an interesting challenge, especially since
nobody else seems to have managed it :-)
Post by Linda Liu[MSFT]
I found a sample of how to embed a Word document in a WinForm application
http://www.codeproject.com/cs/miscctrl/winwordcontrol.asp
That is interesting.

Why does FindWindow return a different Handle from that returned by
Process.Start()? i.e. the example can be modified to work with a variety
of apps if you get their Window Handle using FindWindow. They don't work
if you start them from your own app since the Handle (and
MainWindowHandle) returned by Process doesn't match that returned by
FindWindow.
--
Jeff Gaines
Linda Liu[MSFT]
2007-11-01 08:59:11 UTC
Permalink
Hi Jeff,

Thank you for your prompt reply!

The Process.Handle property returns the associated process's handle which
is assigned to this process by the operating system when the process is
started.

The Win32 API FindWindow function retrieves a handle to a specified
top-level window.

As we can see, the above two kinds of handle are different.

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support
Jeff Gaines
2007-11-01 11:27:14 UTC
Permalink
Post by Linda Liu[MSFT]
The Process.Handle property returns the associated process's handle which
is assigned to this process by the operating system when the process is
started.
The Win32 API FindWindow function retrieves a handle to a specified
top-level window.
As we can see, the above two kinds of handle are different.
OK, a supplementary question :-)

Is there a way to get the same handle that FindWindow returns from the
Process? If I wanted to run, say, 2 copies of Notepad within a Window then
I would need 2 different Handles. Since they would be processes I had
started it would be better to be able to get the handles from Process
since I couldn't be sure with FindWindow which was which.
--
Jeff Gaines
Linda Liu[MSFT]
2007-11-02 09:47:52 UTC
Permalink
Hi Jeff,

Thank you for your prompt reply!

The Process class has provided a property named MainWindowHandle, which
gets the window handle of the main window of the associated process.

The following is a sample:

Process p = Process.Start("Notepad");
System.Threading.Thread.Sleep(1000);
IntPtr hWnd = p.MainWindowHandle;

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support
Jeff Gaines
2007-11-02 19:56:27 UTC
Permalink
Post by Linda Liu[MSFT]
Process p = Process.Start("Notepad");
System.Threading.Thread.Sleep(1000);
IntPtr hWnd = p.MainWindowHandle;
Thanks Linda!

I had tried that and it still returns a different handle to that returned
by FindWindow, most odd.
--
Jeff Gaines
Jeff Gaines
2007-11-02 22:46:19 UTC
Permalink
Post by Jeff Gaines
I had tried that and it still returns a different handle to that returned
by FindWindow, most odd.
I need to correct that.

It returns the same handle with Notepad but with the app I was using (a
Delphi app called A43) Process returned a 'TApplication' window handle,
perhaps an invisible window.
--
Jeff Gaines
Linda Liu[MSFT]
2007-11-05 08:07:20 UTC
Permalink
Hi Jeff,

Thank you for your quick response!

In order to get the "correct" value of the handle, I suggest you to use
Spy++ to identify the handle of the main form.

To do this, launch the Delphi application using the Process.Start method
and then use Spy++ to capture the main form of the application. You could
get the handle of this main form.

Compare the handle captured by Spy++ with that returned from the
MainWindowHandle property of the Process object to see if they match.

Sincerely,
Linda Liu
Microsoft Online Community Support

Continue reading on narkive:
Loading...