473,396 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

C# event processing and windows messages

I have some legacy (C) code that I wnat to use to raise events in a C#
component. Basically, when a condition is true (in the C code), I want
to send a WM_ message (using Win32 API from the C code) to a C#
"listener" component which will then handle the event and any data sent.

So basically (in my C code):

void foo()
{
....
SendMessage(hWnd, Msg, wParam, lParam) ;
...
}

And in my C# code :

void EventSink(....)
{
//Code goes here -
//I don't know how to capture and process the message sent !
}

Feb 25 '06 #1
1 6306

Ubergeek wrote:
I have some legacy (C) code that I wnat to use to raise events in a C#
component. Basically, when a condition is true (in the C code), I want
to send a WM_ message (using Win32 API from the C code) to a C#
"listener" component which will then handle the event and any data sent. //I don't know how to capture and process the message sent !


Override WndProc or PreProcessMessage in your form. Or, if you don't
have a form, and your message pump was started with Application.Run,
you can use Application.AddMessageFilter (not 100% sure this is the
correct way in this situation).
--
Larry Lard
Replies to group please

Feb 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andreas | last post by:
Hi, we have some problems with the following situation: A remote application A writes files to a directory monitored by a FileSystemWatcher-instance in application B. A creates the file with...
2
by: Besta | last post by:
Hello all, I am having trouble creating a windows service with a timer. Everything seems to go ok but the elapsed event does not fire.Can anyone shed any light on this, may be something simple as...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
7
by: Jeff Casbeer | last post by:
New to VB.. What is the VB syntax for posting a Windows event? For example, to have an event fire AFTER a form loads, I'd add a posted call to a "post_load" event, from "load". What is the VB...
12
by: Jack Russell | last post by:
My unstanding of all VB up to and including vb6 is that an event could not "interrupt" itself. For instance if you had a timer event containing a msgbox then you would only get one message. ...
5
by: Chakravarti Mukesh | last post by:
Hi, I want to get an event if someone locks her/his computer so that I could do some finalizations before actually locking the system. For example how can I ensure that an user close a...
3
by: geskerrett | last post by:
We have been asked to develop and application for a client that is a 'notification" system. We would like to use python, but are struggling to find the right starting point. Any suggestions, tips...
4
by: Anis | last post by:
hi, i want to know what is event that windows log in "Event Log". i have read that there r some services that log the event, but at the base level what exactly event is ? and can we make our...
22
by: Oriane | last post by:
Hi there, I have to write an algorithm in .NET/C# which perform some task but has to be stopped after an intreval of dT seconds. Something like: dT = 30sec; for (;;) { t0 = GetCurrentTime...
8
by: Brad Walton | last post by:
Hello. First post, but been doing a bit of reading here. I am working on a project in Java, but decided to switch over to C# after seeing some of the additional features I can get from C#. One of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.