Windows messaging

  • Thread starter Thread starter Jesse Houwing
  • Start date Start date
J

Jesse Houwing

* Accutrol wrote, On 21-10-2009 18:07:
I need to respond to messages broadcast by an application. I cannot modify
that application. The application posts messages by name. I also need to
post messages to that application. These messages are not MSMQ messages.
They are of the WM_ type.

The program I am writing is in LabVIEW. LabVIEW does not interface with
Windows messages directly, but it does interface with ActiveX objects and
.NET objects. If I have to I will figure out how to call Win32 directly
from LabVIEW, but I suspect that there is an easier way. Windows form
controls have a protected method, WndProc(), so I guess I could write a .NET
custom control that handles the messages and reference that custom control
from LabVIEW.

I am unsure of the best newsgroup to post this question, so there are two
questions:

1) Where do I post this message about messaging?

2) If this is an appropriate group, what wrappers are available for
PostMessageByString, RegisterWindowMessage, and GetMessage?

Thanks for any help,
Hamilton Woods

My Guess... Try one of these:

microsoft.public.dotnet.framework.windowsforms
microsoft.public.dotnet.framework.interop
 
I need to respond to messages broadcast by an application. I cannot modify
that application. The application posts messages by name. I also need to
post messages to that application. These messages are not MSMQ messages.
They are of the WM_ type.

The program I am writing is in LabVIEW. LabVIEW does not interface with
Windows messages directly, but it does interface with ActiveX objects and
..NET objects. If I have to I will figure out how to call Win32 directly
from LabVIEW, but I suspect that there is an easier way. Windows form
controls have a protected method, WndProc(), so I guess I could write a .NET
custom control that handles the messages and reference that custom control
from LabVIEW.

I am unsure of the best newsgroup to post this question, so there are two
questions:

1) Where do I post this message about messaging?

2) If this is an appropriate group, what wrappers are available for
PostMessageByString, RegisterWindowMessage, and GetMessage?

Thanks for any help,
Hamilton Woods
 
Hello, Hamilton,

If you use a custom control and WndProc, I think that you will need to
arrange for the messages to be sent specifically to that control's window. I
don't know LabView, so perhaps this is no problem.

But you might want to consider Application.AddMessageFilter. By setting up
a message filter you can capture any message sent to the application.

To send messages in the other direction, you can use the ~~~ API. In VB you
would declare it something like:

Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
(ByVal hwnd As IntPtr, ByVal wMsg As Integer, _
ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean

Cheers,
Randy
 
Back
Top