Receive Windows Broadcast Messages from a C++ program.

  • Thread starter Thread starter siujoe
  • Start date Start date
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!!!
 
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.
 
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?
 
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.
 
Back
Top