473,326 Members | 2,147 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,326 software developers and data experts.

Windows Messages....

GTi
I need to get access to the Windows Messages queue (WM_xxx)
I have a old C application that sends some messages to all windows
on the computer. How can my new C# application receive this message?

Nov 17 '05 #1
5 2454
GTi,

In your main form, you can override the WndProc method and it will be
called whenever it receives a message from the loop. However, you have to
make sure you call the base implementation to WndProc so that other messages
get processed as well.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"GTi" <bl****@blabla.com> wrote in message
news:Og**************@TK2MSFTNGP12.phx.gbl...
I need to get access to the Windows Messages queue (WM_xxx)
I have a old C application that sends some messages to all windows
on the computer. How can my new C# application receive this message?

Nov 17 '05 #2
From which "window" (aka Form, Control, etc in .NET WinForms)?

If it's just the form in general, in your WhateverForm.cs class, override
the WndProc or DefWndProc method as appropriate.

There's also an "OnNotifyMessage" method that you should use, instead, if
you're dealing with notify messages.

If it's a control (like a button or listbox or something), then you'll have
to create your own class that derrives from that class (Button, ListBox,
etc) and override the WndProc method as necessary.

-c
"GTi" <bl****@blabla.com> wrote in message
news:Og**************@TK2MSFTNGP12.phx.gbl...
I need to get access to the Windows Messages queue (WM_xxx)
I have a old C application that sends some messages to all windows
on the computer. How can my new C# application receive this message?

Nov 17 '05 #3
GTi
Thanks all...
But I wonder what is most cost effective:
(if it matter)
Using: WndProc or OnNotifyMessage
Nov 17 '05 #4
There shouldn't be any noticeable differences.

"GTi" <gt*@gti.com> schrieb im Newsbeitrag news:42******@news.wineasy.se...
Thanks all...
But I wonder what is most cost effective:
(if it matter)
Using: WndProc or OnNotifyMessage

Nov 17 '05 #5
GTi
k

"cody" <de********@gmx.de> wrote in message
news:OQ****************@TK2MSFTNGP09.phx.gbl...
There shouldn't be any noticeable differences.

"GTi" <gt*@gti.com> schrieb im Newsbeitrag
news:42******@news.wineasy.se...
Thanks all...
But I wonder what is most cost effective:
(if it matter)
Using: WndProc or OnNotifyMessage


Nov 17 '05 #6

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

Similar topics

0
by: piyush | last post by:
Sorry for repeated posting but I couldnt get things right/completely in the first post. I am in the process of deciding the IPC mechanisms to use for communication between 1) An application...
4
by: davidstummer | last post by:
I was wondering if anyone could point me to an example. Currently i have a c++ program which calls and c++ dll (i created both). The dll uses SendMessage to pass messages back to the calling .exe,...
1
by: Artur Kowalski | last post by:
I have a NotifyIcon in my Windows Service project and I am trying to add a ContextMenu to this NotifyIcon or use some of the mouse events. Everything isn't working. I think so base class of the...
0
by: piyush | last post by:
Sorry for repeated posts, I couldnt get things right and complete in the previous post. I am in the process of deciding the IPC mechanisms to use for communication between 1) An application...
14
by: Brian Keating EI9FXB | last post by:
I wonder can anyone reccomment a solution to this problem. Let me explain, I've services running on my system, my application receives diagnostic messages from these services, what i want to do...
3
by: Brian Keating EI9FXB | last post by:
Hello again, I've already placed a few posts on this topic. This time i've a simple application that exhibits my problem, I've placed sample solution 8k on my website should anyone be interested...
8
by: Brian Keating EI9FXB | last post by:
Would I be correct in saying that the only way to get a user message into a Windows form would be to use P/Invoke with Message? Of is there some part of the .NET API that I am totally un aware...
3
by: Javaman59 | last post by:
I've spent the last 3 years programming VC++, and learnt that Windows programming is all about messages. Now I'm doing C#, and there isn't a windows message to be seen! Now, I don't miss those...
14
by: | last post by:
Hi All, I am little confused here, hope you can help me. While processing WM_POWERBROADCAST (wParam=PBT_APMQUERYSUSPEND), I MUST to do some lengthy operation(30 sec) before system Suspends or...
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.