Hello,
Sometimes, when you're at office without admin rights or poweruser rights, you are feeling kinda bitter...
And to send messages to your collegues, you have to use the NET SEND mycollegue TheMessage blahhh
to discuss a bit...
Yes, but exchnaging those kinda msg is heavy and not convivial, plus you can't grab the text that is just popped at screen...
I've found a solution !
I've developped a tiny GUI application that is in charge of scruting for incoming net sended messages, grabbing its very content, redirecting the message into a richedit control + logging the very content of the popped messages + closing the popped message !!!
Here's a screen shot of a just grabbed popped message :
Here's the main script that does the trick :
#Option Explicit
#DllDeclare User32( "EnumWindows", "GetWindowText", "GetWindowTextLength", _
"GetDlgItem", "SetFocus", "FindWindow", "FlashWindow" )
' // Replace with the correct translation here
Const service = "Service Affichage des messages "
Const sep = "--------------------------------------------------------------------------------"
Const STYLE = WS_CHILD + WS_CLIPSIBLINGS + WS_VISIBLE + WS_HSCROLL + WS_VSCROLL + ES_MULTILINE + _
ES_AUTOVSCROLL + ES_AUTOHSCROLL + WS_TABSTOP
LoadLibrary("Riched20.dll")
Dim %H = 420, %W = 220, $sGet, %fp
Resize( Me, 0, 0, H, W )
Dim hwndInput = FBSL_Control ( _
"richedit20a", Me, "", 1000, 20, 20, H-40, W-40, STYLE, WS_EX_CLIENTEDGE )
Fbsl_settext( Me, "NET Send Capturer / logger" )
SetTimer(Me, 3615, 100)
fp = Fileopen( ".\Capturer.log", Append )
Center(Me): ResizeMe(): Show(Me)
Begin Events
If cbmsg = wm_close Then
Killtimer( Me, 3615 )
Fileclose( fp )
Exitprogram(0)
End If
If cbmsg = wm_timer Then
MyGetNetSend()
End If
If cbmsg = wm_size Then
ResizeMe()
End If
End Events
Sub MyGetNetSend()
Dim %hwnd = FindWindow(Null, service )
Dim %Ret = GetWindowTextLength(hwnd)
If Ret > 0 Then
Dim $sSave, %hdlg
sSave = Space(Ret)
GetWindowText( hwnd, sSave, Ret + 1 )
If Left(sSave, Len(service)) = service Then
' // Message Window
hdlg = GetDlgItem( hwnd, 0xFFFF )
Ret = GetWindowTextLength(hdlg)
sSave = Space(Ret)
GetWindowText( hdlg, sSave, Ret + 1 )
Sendmessage( hwnd, WM_CLOSE, 0, 0 )
Fbsl_Gettext( hwndInput, sGet )
sGet = sGet & sSave & CrLf & sep & CrLf
Fbsl_Settext( hwndInput, sGet )
Fileprint( fp, sSave )
FlashWindow( Me, True )
End If
End If
End Sub
Sub ResizeMe()
Dim %TopWin, %leftWin, %RightWin, %BottomWin
GetClientRect(Me, TopWin, leftWin, RightWin, BottomWin )
Resize( hwndInput, 20, 20, RightWin - 40, BottomWin - 60 )
End Sub
The only thing to adapt into that script will be this only line :
Const service = "Service Affichage des messages "
It was tested onto : NT4, Win2k and WinXP French versions with success
And what about you ?
Tell me please