Link to home
Start Free TrialLog in
Avatar of d1kGroup
d1kGroup

asked on

copture all incoming net send messeges!

how i can capture all incoming messeges sended with "net send" command under nt platform?
ASKER CERTIFIED SOLUTION
Avatar of shaneholmes
shaneholmes

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shaneholmes
shaneholmes

Sorry, you will need to add Netapi32 to your uses clause

Shane
Avatar of d1kGroup

ASKER

i look in msdn an NetAlertRaise and it's look to be what i need but is not NetAPI32.dcu in delphi! can you give me a header of NetAPI.dll???
or (better) a simple delphi example!!!

d1k
no more need header for netapi.dll!!
i found it!! it's call lm!!!
K, let me know if you need anymore help!

Shane
i tryed NetAlertRaise but not working...

pls give a simple example!!!

d1k
You tried it that quick!

Shane
i just translate the msdn example!!!

d1k
please post me what you used for code...

ANd I will look

Shane
Shane, here is the code i tried:

const
  VAREDSIZE = 312;
type
  TPUSER_OTHER_INFO = record
                        alrtus_errcode: Integer;
                        alrtus_numstrings: Integer;
  end;
var
  buf: array [0..VAREDSIZE] of char;
  pUserInfo: ^TPUSER_OTHER_INFO;
begin
  FreeMem(pUserInfo, VAREDSIZE);
  pUserInfo.alrtus_errcode := -1;
  pUserInfo.alrtus_numstrings := 1;
  if NetAlertRaiseEx(ALERT_MESSAGE_EVENT, pUserInfo, 255, 'netsvcs') = NERR_Success then begin
    ShowMessage('something is coming!!!');
  end;

d1k
i forgot to mention that it raise an exception!!!
prb service is not called netsvcs... but how???
i tried too

NetAlertRaiseEx(ALERT_MESSAGE_EVENT, pUserInfo, VAREDSIZE, 'svchost.exe')

but it raise the same exception!!!

   You need mail slot component. Download some of them from here :

   http://swiss.torry.net/lan_comms.htm

   I use Mailslot v.1.1 - you just install it, drop on the form and write you code in OnNewMessage event...
i try all mail slots components from torry.net but noone capture messeges sended with "net send"!!!

d1k
more info: i don't want a replacer for Messenger service... i junst want to capture all incoming messeges!!!!

d1k