Page 1 of 2 12>
Topic Options
#92795 - 2003-09-09 09:08 PM capture net send messages
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
does anyone know how to do this sort of thing???
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#92796 - 2003-09-09 09:33 PM Re: capture net send messages
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
You mean like this http://www.codeproject.com/csharp/pacanal.asp ? Or just capture the text in it?

Haven't tried it yet but will do on our test network tomorrow at work.

[ 09. September 2003, 21:36: Message edited by: R2D2 ]
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#92797 - 2003-09-09 09:34 PM Re: capture net send messages
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Rad,

You can always use ALT+PRTSCN or better yet - http://www.structurise.com/kleptomania (not free).

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#92798 - 2003-09-09 09:38 PM Re: capture net send messages
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Rad,
Maybe you should elaborate. I presume you want to use NetSend for inter-process communication. If so, maybe MSMQ is what you seek.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#92799 - 2003-09-09 09:44 PM Re: capture net send messages
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
basically I want to capture the text from a received net send message...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#92800 - 2003-09-09 09:47 PM Re: capture net send messages
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
A simple Ctrl-C in W2K/XP will copy the text only to the clipboard.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#92801 - 2003-09-09 09:50 PM Re: capture net send messages
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
hmmm.... I think I can work that.

hehehehe

thanks

I tested:
quote:

---------------------------
Messenger Service
---------------------------
Message from WHEELERC to WHEELERC on 9/9/2003 3:57:44 PM

is howard full of shizit?
---------------------------
OK
---------------------------


_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#92802 - 2003-09-09 09:53 PM Re: capture net send messages
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Glad to be of assistance...seems like you were not initially a believer [Wink] That will teach you.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#92803 - 2003-09-09 09:59 PM Re: capture net send messages
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
ok.... Do you have a way of reading from the clipboard??
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#92804 - 2003-09-09 10:08 PM Re: capture net send messages
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
apparently Setfocus can't find the messenger window...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#92805 - 2003-09-09 10:11 PM Re: capture net send messages
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Ctrl-V [Confused]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#92806 - 2003-09-09 10:37 PM Re: capture net send messages
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I have some code to parse the output of a pasted 'message'

But I still can't get setfocus to connect and I can't think of a way to read the text without pasting it to a text doc.

code:
 
$text = ReadFile($temp)
$header = split($text[3])
for $l = 5 to ubound($text) - 4
$body = $body + @crlf + $text[$l]
next
$from = $header[2]
$to = $header[4]
$date = $header[6]
$time = $header[7] + ' ' + $header[8]
$body = substr($body,2)

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#92807 - 2003-09-09 10:59 PM Re: capture net send messages
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Seem to recall that AutoIT can read test on dialog boxes. There is a COMmable piece too.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#92808 - 2003-09-10 12:30 AM Re: capture net send messages
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
AutoITX can also manipulate the clipboard.
Top
#92809 - 2003-09-10 12:50 AM Re: capture net send messages
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
now, can't you just paste the text to form that like just flashes.
show form, do paste on textbox, hide form, read the text.
_________________________
!

download KiXnet

Top
#92810 - 2003-09-10 02:11 AM Re: capture net send messages
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Rad,

The info is also stored in the eventlog-system...
Look for "application popup"

Now how to read the systemlog???

{edit}

UDF --> http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=12;t=000270

[ 10. September 2003, 02:13: Message edited by: MightyR1 ]
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#92811 - 2003-09-10 02:25 AM Re: capture net send messages
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
To get the last message (thanks Jens for the UDF):



Break on
$rc=SetOption(wrapateol,'on')
$events=Readeventlog('system',26)
$ = $events[0,9]
$

Exit 0

;FUNCTION      ReadEventlog()
;
;ACTION        Retrieves events from the eventlog
;
;AUTHOR        Jens Meyer
;
;VERSION       1.5
;
;KIXTART VER   4.20
;
;SYNTAX        RETCODE = READEVENTLOG(EVENTLOG, EVENTID, OPTIONAL COMPUTER, OPTIONAL DATETIME,
;                                     OPTIONAL USERNAME, OPTIONAL PASSWORD)
;
;PARAMETERS    EVENTLOG
;              Name of the eventlog, e.g. 'Security', 'System','Application'
;              Alternatively, a custom WQL query can be provided. Date fields in
;              a WQL query MUST be properly formatted as YYYY/MM/DD HH:MM:SS:000
;
;              EVENTID
;              Optional Event ID number to be retrieved
;
;              COMPUTER
;              optional name of a remote computer which eventlog is to be queried. If no
;              username/password is provided then the current users credentials will be
;              used to connect to the remote event log.
;
;              DATETIME
;              optional date/time string denoting the start date of the events in
;              the form of YYYY/MM/DD HH:MM:SS, YYY/MM/DD, or HH:MM:SS
;
;              USERNAME
;              optional username which will be used to connect to a remote computer
;
;              PASSWORD
;              optional password which will be used to connect to the remote computer
;
;RETURN        array of events or empty string
;
;REMARKS       returns a 2-dimensional array with the following columns. If custom WQL is
;              used, then the SELECT part of the custom WQL determines the field assignments.
;
;              Column  0 = Category
;              Column  1 = CategoryString
;              Column  2 = ComputerName
;              Column  3 = Data
;              Column  4 = EventCode
;              Column  5 = EventIdentifier
;              Column  6 = EventType
;              Column  7 = InsertionStrings
;              Column  8 = Logfile
;              Column  9 = Message
;              Column 10 = RecordNumber
;              Column 11 = Source Name
;              Column 12 = TimeGenerated
;              Column 13 = TimeWritten
;              Column 14 = Type
;              Column 15 = User
;
;DEPENDENCIES  WMI
;
;EXAMPLE       $events = ReadEventlog('Security',528)
;              $events = ReadEventlog('Security',528,,'COMPUTER')
;              $events = ReadEventlog('Security',528,'2002/09/01 00:00:00','COMPUTER','Administrator','password')
;              $events = ReadEventlog('SELECT TimeGenerated, User FROM Win32_NTLogEvent
;                                      WHERE Logfile="Security" AND EventCode=528 AND
;                                      TimeGenerated>="2002/09/01 00:00:00:000"'
;
;KIXTART BBS   http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000270
;
Function ReadEventlog($eventlogoptional $eventidoptional $computeroptional $datetimeoptional $usernameoptional $Password)
  Dim $objLocator$objWBEM$objWMIResults$namespace$objWMIResultsCopy
  Dim $event$item$wqlQuery$eventarray$itemname$itemvalue
  Dim $customwql$customfields$field
  Dim $rownumber$arrayrows$arraycolumns$columnnumber
  Dim $byte$datastring$date$time$querydate$querytime$timezone
  Dim $objWMIService$colItems$objItem

  $namespace = 'root\CIMV2'
  $arrayrows=50

  If Trim($eventlog)=''
    Exit 87
  EndIf

  ; check to see whether we're connecting to a local or remote eventlog
  $computer=Trim($computer)
  Select
  Case $computer=@WKSTA
    $computer='.'
  Case $computer
  Case 1
    $computer='.'
  EndSelect

  If $username AND $computer<>'.'
    ; create locator object for connection to a remote computer
    $objLocator = CreateObject('WbemScripting.SWbemLocator')
    If @ERROR
      Exit @ERROR
    EndIf
    ; create a (credentialed, if username/password provided) connection to a remote computer
    $objWBEM=$objLocator.ConnectServer($computer,$namespace,$username,$Password)
    If @ERROR
      Exit @ERROR
    EndIf
    ; set the impersonation level
    $objWBEM.Security_.ImpersonationLevel = 3
    If @ERROR
      Exit @ERROR
    EndIf
  Else
    ;set the impersonation level and make sure we have security permissions
    If $eventlog='Security' OR (Left($eventlog,6)='select' AND InStr($eventlog,'Security') AND InStr($eventlog,'Logfile'))
      $objWBEM=GetObject('winmgmts:{impersonationLevel=impersonate, (Security)}!\\'+$computer+'\'+$namespace)
    Else
      $objWBEM=GetObject('winmgmts:{impersonationLevel=impersonate}!\\'+$computer+'\'+$namespace)
    EndIf
    If @ERROR
      Exit @ERROR
    EndIf
  EndIf

  ; check to see whether we're looking for an event ID or if there's a custom query
  If Left($eventlog,6)='select'
    $wqlquery=$eventlog
    $arraycolumns=Trim(SubStr($wqlquery,InStr($wqlquery,' ')+1,InStr($wqlquery,'FROM')-InStr($wqlquery,' ')-2))
    If InStr($arraycolumns,'*')
      $arraycolumns=16
      $customwql=0
    Else
      $customfields=Split(Trim($arraycolumns),',')
      For $arraycolumns=0 to Ubound($customfields)
        $customfields[$arraycolumns]=Trim($customfields[$arraycolumns])
      Next
      $arraycolumns=Ubound($customfields)+1
      $customwql=1
    EndIf
  Else
    $customwql=0
    $arraycolumns=16
    $eventid=Val($eventid)
    $wqlQuery="SELECT * FROM Win32_NTLogEvent WHERE Logfile='"+$eventlog+"' AND EventCode="+Val($eventID)

    If $datetime
      $colItems = $objWBEM.ExecQuery('Select CurrentTimeZone from Win32_ComputerSystem')
      If @ERROR
        Exit @ERROR
      EndIf

      For Each $objItem In $colItems
        $timezone = $objItem.CurrentTimeZone
      Next

      $objWMIService = 0
      $colItems = 0
      $objItem = 0

      $datetime=Trim($datetime)

      Select
      Case InStr($datetime,' ')
        $date=Left($datetime,InStr($datetime,' ')-1)
        $time=SubStr($datetime,InStr($datetime,' ')+1)
      Case InStr($datetime,'/')
        $date=$datetime
        $time='00:00:00'
      Case InStr($datetime,':')
        $date=@DATE
        $time=$datetime
      Case 1
        $date=@DATE
        $time=@TIME
      EndSelect
      If $date AND $time
        $datetime=Join(Split($date,'/'),'')+Join(Split($time,':'),'')+'.000000'+$timezone
      Else
        $datetime=''
      EndIf

      $wqlQuery=$wqlQuery+' AND TimeGenerated>="'+$datetime+'"'
    EndIf
  EndIf

  $objWMIResults = $objWBEM.ExecQuery($wqlQuery,'WQL',48)
  If @ERROR
    Exit @ERROR
  EndIf

  $rownumber = 0
  $columnnumber = 0

  For Each $event In $objWMIResults
    If $rownumber mod $arrayrows = 0
      ReDim preserve $eventarray[$rownumber+$arrayrows]
    EndIf
    $eventarray[$rownumber]=$event.Properties_
    $rownumber=$rownumber+1
  Next
  If $rownumber
    ReDim preserve $eventarray[$rownumber-1]
  Else
    $ReadEventlog=''
    Return
  EndIf

  ReDim $readeventlog[$rownumber-1,$arraycolumns-1]
  $rownumber=0
  For Each $event In $eventarray
    $columnnumber = 0
    For Each $item In $event
      $itemname=$item.name
      $itemvalue=$item.value
      If $customwql=0 OR AScan($customfields,$itemname)+1
        Select
        Case $itemname='Data'
          $datastring=''
          For Each $byte In $item.value
            If $byte=0
              $byte=46
            EndIf
            $datastring=$datastring+Chr($byte)
          Next
          $readeventlog[$rownumber,$columnnumber]=$datastring
        Case $itemname='InsertionStrings'
          $readeventlog[$rownumber,$columnnumber]=Join($itemValue,@CRLF)
        Case $itemname='TimeGenerated' OR $itemName='TimeWritten'
          $time=Left($itemValue,4)+'/'+SubStr($itemValue,5,2)+'/'+SubStr($itemValue,7,2)+' '
          $time=$time+SubStr($itemValue,9,2)+':'+SubStr($itemValue,11,2)+':'+SubStr($itemValue,13,2)
          $readeventlog[$rownumber,$columnnumber]=$time
        Case 1
          $readeventlog[$rownumber,$columnnumber]=$itemValue
        EndSelect
        $columnnumber=$columnnumber+1
      EndIf
    Next
    $rownumber=$rownumber+1
  Next

  $objWMIResults = 0
  $objWBEM = 0
  $objLocator = 0

  Exit 0

EndFunction



{edit}

Apolagies for the long lines...

[ 26. September 2003, 07:28: Message edited by: MightyR1 ]
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#92812 - 2003-09-10 02:39 AM Re: capture net send messages
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
pat, did you manually screw up the font-color or what?
_________________________
!

download KiXnet

Top
#92813 - 2003-09-10 05:56 AM Re: capture net send messages
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I didn't want to use any other utils, but the autoitx.dll does it perfectly...

Please stand by... [Big Grin]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#92814 - 2003-09-10 06:22 AM Re: capture net send messages
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
code:
 
break on
;$=setconsole("minimize")

$autoIt=CreateObject("AutoItX.Control")

do
if $AutoIt.IfWinExist("Messenger Service", "")
$=$AutoIt.WinActivate("Messenger Service", "")
$=$AutoIt.Send("^c")
$=$AutoIt.WinClose("Messenger Service", "")
$Paste=$AutoIt.ClipGet()
$text=split($paste,@crlf)
$header = split($text[3])
$body = ''
for $l = 5 to ubound($text) - 4
$body = $body + @crlf + $text[$l]
next
$from = $header[2]
$to = $header[4]
$date = $header[6]
$time = $header[7] + ' ' + $header[8]
$body = substr($body,3)
? $from
? $body
? '----'
endif
sleep 1
until @error

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
Page 1 of 2 12>


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.075 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org