Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AppActivate & SendKeys

Status
Not open for further replies.

Skie

Programmer
Jun 21, 2004
475
US
I loop my script to close Net Send messages as they appear. I want to receive the message (so Net Stop Messenger wouldn't work), I just don't want to see the messages. Is there a more reliable way to close the messages other than using AppActivate with SendKeys? To my understanding, if any window contained "Messenger Service", then check would be true and "{enter}" would be sent into that window.

Code:
Set objWshShell = Wscript.CreateObject("Wscript.Shell")

While 1 = 1
  check = objWshShell.AppActivate("Messenger Service")
  If check = true then objWshShell.SendKeys "{enter}"
  Wscript.Sleep(100)
Wend
 
You would need to execute this script to close the messages, so what's the difference between doing that and closing the message?

If you don't want ANY mesages then disable the messenger service on your PC.

I hope you find this post helpful.

Regards,

Mark
 
The script loops, so it'd close out the messages as they come in. There'd be no need for me to do close any of them.

I want the messages. I don't want the pop-ups. I can pull the messages into a log provided I receive them, but disabling the messenger would prevent me from receiving them.
 
What is the application for this that you get so many messenger alerts that you need to have a script running all the time? Seems to me you should be able to design an alternate method to populate your log.



I hope you find this post helpful.

Regards,

Mark
 
I receive quite a few net sends from users. Sometimes it'll be hours before I receive a message and other times I'll receive 20+ messages in a minute. With the script, I don't see the messages as they come in. I can access the log at any time which allows me to easily copy/paste part of the message (like a URL). If you have better alternatives, I'd love to hear them. However, I need something that will:
1. Notify the sender if the recipient is not logged onto the system
2. Send a message instantly
3. Logs the messages
4. Doesn't require setup for the recipient
 
I'd do this with a web page.

1. It is possible with WMI to have a web page determine if you are logged onto your PC (if you use the same one all the time).

2. You can have then type a message into the web page.

3. Have the message be stored in a database

4. The users would just need a web browser.

I posted the code to determine the user logged in to a PC in thread329-1164482. I think that should be a good start for you.

You could take this all one step further and have database fileds to show if you have acknowledged the message yet, resolved the issue whatever. That way your users don't have to bug you, they can just look on the web site for a status update.



I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top