PC Review


Reply
Thread Tools Rate Thread

How can I handle windows message within my .net program?

 
 
Xnostaw
Guest
Posts: n/a
 
      2nd Feb 2004
Hi all,

I have a native program app1 written in vc6 and a .net one named app2
written by c#.

I need to handle the custmize windows message sent from the app1 to app2.But
I dont known how to process all these wm_xxx mixtured with the event model.

Mind anyone will be useful and valuable.


 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      2nd Feb 2004

>I need to handle the custmize windows message sent from the app1 to app2.But
>I dont known how to process all these wm_xxx mixtured with the event model.


Override the WndProc method of your form.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
Hubert Hermanutz
Guest
Posts: n/a
 
      2nd Feb 2004
Hello,

few weeks before I have solved the same problem about the static import of
the native Win-API functions (GetWindowThreadProcessId,
RegisterWindowMessages and PostMessage) about the DllImport-Attribute.

For receiving of messages I have used follow items in my receiving Form
class:


[System.Security.Permissions.PermissionSet(System.Security.Permissions.Secur
ityAction.Demand, Name="FullTrust")]
protected override void WndProc(ref Message m)
{
const int const_WM_APP=0x8000;
if(m.Msg==const_WM_APP+1) {
//do something
}

base.WndProc(ref m);
}

All the best,
Hubert



"Xnostaw" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> Hi all,
>
> I have a native program app1 written in vc6 and a .net one named app2
> written by c#.
>
> I need to handle the custmize windows message sent from the app1 to

app2.But
> I dont known how to process all these wm_xxx mixtured with the event

model.
>
> Mind anyone will be useful and valuable.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows XP Message 'End Program - O' =?Utf-8?B?TmFyYXlhbmEgU3VicmFtYW5pYW0=?= Windows XP General 0 11th Nov 2006 04:54 PM
How to handle Windows message in Form. =?Utf-8?B?SmFpa2FudA==?= Microsoft Dot NET Compact Framework 11 4th May 2006 12:30 PM
Handle the Windows Lock Desktop event/message? brandon@bc3tech.net Microsoft C# .NET 4 16th Jan 2006 03:06 PM
Get handle to external program from Windows Service lcifers Microsoft VB .NET 0 5th Jan 2006 04:03 PM
Windows XP, "unable to open internet handle" Error Message radman Windows XP General 3 18th Apr 2004 07:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:15 PM.