J Trahair
Well-known member
Hi. I am trying to SendMessage to an app called 'Signal threads' - a test app which sends out a message called TV1_Threads, and listens for a reply. I have shown the values of each variable in the commented areas.
ret = 0 and the receiving app (Signal threads) does not show that the message was received.
If I use the BROADCAST way of doing it,
this way works great and the Signal threads app responds every time.
What's wrong with the first code sample? Thanks in advance.
VB.NET:
Dim windowHandle As Integer
Dim controlHandle As Integer
Dim WM_SEE_VB_MESSAGE_1 As Integer
Dim ret As Integer
windowHandle = FindWindow(vbNullString, "Signal threads") '2623292
controlHandle = FindWindowEx(windowHandle, 0, vbNullString, vbNullString) '2426820
WM_SEE_VB_MESSAGE_1 = RegisterWindowMessage("TV1_Threads") '50187
ret = SendMessage(controlHandle, WM_SEE_VB_MESSAGE_1, 0, 0) '0
ret = 0 and the receiving app (Signal threads) does not show that the message was received.
If I use the BROADCAST way of doing it,
VB.NET:
Dim HWND_BROADCAST As Integer = &HFFFF&
Dim WM_SEE_VB_MESSAGE_1 As Integer
Dim ret As Integer
WM_SEE_VB_MESSAGE_1 = RegisterWindowMessage("TV1_Threads")
ret = SendMessage(HWND_BROADCAST, WM_SEE_VB_MESSAGE_1, 0, 0)
What's wrong with the first code sample? Thanks in advance.