Article View: borland.public.csharpbuilder.language.csharp
Article #500Re: Receiving a Windows message in .NET
From: Theo Bebekis
Date: Tue, 02 Nov 2004 07:50
Date: Tue, 02 Nov 2004 07:50
38 lines
2187 bytes
2187 bytes
Marc Rohloff [TeamB] wrote:
> On Sat, 30 Oct 2004 13:07:32 +0100, Ray wrote:
>
>
>>I want to receive a Windows message in a C# application. I had hoped that
>>there was a means for doing that but can only find the Message class which
>>doesn't seem to be appropriate.
>>
>>Presumably I must use interop to overload WndProc but I am not sure how to
>>do this.
>
>
> You shouldn't need to use interop, just override the WndProc method of
> your form.
>
Also, take a look at the System.Windows.Forms.NativeWindow class.
Deriving your class from NativeWindow can turn it into a class
capable of receiving messages, since that class provides a WndProc.
BTW, is there a way to send/post messages other than importing
SendMessage() and PostMessage() WinAPI functions?
--
Regards
Theo
------------------------
Theo Bebekis
Thessaloniki, Greece
------------------------
Greek_Delphi_Prog : a Delphi Programming mailing list in Greek at
http://groups.yahoo.com/group/Greek_Delphi_Prog
atla_custom : a Unisoft Atlantis Customization mailing list at
http://groups.yahoo.com/group/atla_custom
------------------------
Technical Details
Message-ID:
<41873c1b$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41838405@newsgroups.borland.com> <o61k9i02piws$.dlg@marcrohloff.40tude.net>Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,199011f4d279395c X-Google-Attributes: gid1efe35,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 02 Nov 2004 09:50:03 +0200 From: Theo Bebekis <teo@thinx.gr> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: el, en-us, en MIME-Version: 1.0 Newsgroups: borland.public.csharpbuilder.language.csharp Subject: Re: Receiving a Windows message in .NET References: <41838405@newsgroups.borland.com> <o61k9i02piws$.dlg@marcrohloff.40tude.net> In-Reply-To: <o61k9i02piws$.dlg@marcrohloff.40tude.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 62.103.76.94 Message-ID: <41873c1b$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1099381787 62.103.76.94 (1 Nov 2004 23:49:47 -0700) Lines: 38 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail