Receive Windows Broadcast Messages from a C++ program.

S

siujoe

Hi,

My app is written in vb.net 2003, I need to receive broadcast messages
sent from another application written in VC++6.


It doesn't seem i can import system.messaging, I also tried windows
API RegisterWindowMessage but no luck.


Hope someone can give me some suggestions.


Thanks!!!
 
P

Phill W.

siujoe said:
My app is written in vb.net 2003, I need to receive broadcast messages
sent from another application written in VC++6.

"Broadcast Message"?
Does that translate to a Windows Message?
If so, override WndProc in your Form and pick out the relevant Message.

HTH,
Phill W.
 
S

siujoe

Thanks Phill,

Yes it is Windows Message, I found some examples on vb6, but having problem
translating to vb.net...

how do you convert Addressof funcname to vb.net?
 
P

Phill W.

siujoe said:
Yes it is Windows Message, I found some examples on vb6, but having problem
translating to vb.net...

Handling Windows Messages is done totally different in VB.Net.
Pop this into your Form code:

Protected Overrides Sub WndProc(ByRef m As Message)

Const WM_ACTIVATEAPP as Integer = &H1C

Select Case m.Msg
Case WM_ACTIVATEAPP

' Switch from another Application

End Select

' Very, *very* important bit!!
MyBase.WndProc(m)

End Sub

HTH,
Phill W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top